上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 36 下一页
摘要: Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such p 阅读全文
posted @ 2014-12-12 01:25 LiBlog 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,... 阅读全文
posted @ 2014-12-12 00:50 LiBlog 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the... 阅读全文
posted @ 2014-12-11 23:59 LiBlog 阅读(155) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index... 阅读全文
posted @ 2014-12-10 07:06 LiBlog 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Solution: Solution 2: Whenever the value o 阅读全文
posted @ 2014-11-29 10:52 LiBlog 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.Solution: 1 public class Solution { 2 public String longestC... 阅读全文
posted @ 2014-11-29 10:36 LiBlog 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After ... 阅读全文
posted @ 2014-11-29 10:26 LiBlog 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the c... 阅读全文
posted @ 2014-11-29 10:08 LiBlog 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2014-11-29 09:58 LiBlog 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02):The s... 阅读全文
posted @ 2014-11-29 07:46 LiBlog 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 36 下一页