Palindrome Partitioning
摘要:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
阅读全文
posted @
2014-11-30 20:17
Chris兔的小佳佳
阅读(143)
推荐(0)
Leetcode Candy
摘要:There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requi...
阅读全文
posted @
2014-11-25 15:51
Chris兔的小佳佳
阅读(118)
推荐(0)
Leetcode Single Number
摘要:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
阅读全文
posted @
2014-11-25 13:12
Chris兔的小佳佳
阅读(141)
推荐(0)
Leetcode Single Number II
摘要:Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp...
阅读全文
posted @
2014-11-25 13:08
Chris兔的小佳佳
阅读(121)
推荐(0)
Leetcode Copy List with Random Pointer
摘要:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ...
阅读全文
posted @
2014-11-23 22:16
Chris兔的小佳佳
阅读(142)
推荐(0)
Leetcode Word Break
摘要:Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl...
阅读全文
posted @
2014-11-23 16:07
Chris兔的小佳佳
阅读(160)
推荐(0)
Leetcode Linked List Cycle
摘要:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?这道题用来判断链表中是否有循环,最开始我想的是遍历链表,同时用一个list保存遍历过...
阅读全文
posted @
2014-11-20 23:28
Chris兔的小佳佳
阅读(132)
推荐(0)
Leetcode Reorder List
摘要:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
阅读全文
posted @
2014-11-20 21:51
Chris兔的小佳佳
阅读(152)
推荐(0)
Leetcode LRU Cache
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
阅读全文
posted @
2014-11-20 12:28
Chris兔的小佳佳
阅读(126)
推荐(0)
Leetcode Reverse Integer
摘要:对于这一道题乍一看比较简单,但实际操作中要考虑到是否有溢出,因此操作的结果应存在一个long类型的变量中,然后检测该变量是否溢出,若溢出则为0; 1 package ReverseInteger; 2 3 import java.util.ArrayList; 4 import java.util...
阅读全文
posted @
2014-11-13 20:42
Chris兔的小佳佳
阅读(164)
推荐(0)
Leetcode Longest Substring Without Repeating Characters
摘要:对于这道题目我最开始的想法是用一个list来保存字符串中的元素,先遍历字符串中的字符,若该字符没有在list中则将该字符添加到list中,若有重复的字符则将该list清空。但没有考虑到一个问题,此时遍历的索引应该回到第一次出现重复字符的下一个字符处,好了问题来了,list中无法找到该字符的索引信...
阅读全文
posted @
2014-11-03 17:08
Chris兔的小佳佳
阅读(145)
推荐(0)