摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2015-06-29 10:30 Grandyang 阅读(25224) 评论(5) 推荐(2) 编辑
摘要: Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3,4,5], n = 2 Output: 阅读全文
posted @ 2015-06-29 10:28 Grandyang 阅读(20384) 评论(15) 推荐(0) 编辑
摘要: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
posted @ 2015-06-29 09:52 Grandyang 阅读(25840) 评论(11) 推荐(0) 编辑
摘要: You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list 阅读全文
posted @ 2015-06-29 08:59 Grandyang 阅读(39894) 评论(14) 推荐(1) 编辑
摘要: Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return  阅读全文
posted @ 2015-06-29 08:54 Grandyang 阅读(15468) 评论(0) 推荐(0) 编辑
摘要: Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Exampl 阅读全文
posted @ 2015-06-29 08:51 Grandyang 阅读(21675) 评论(2) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". Update (2015-02-12): For C 阅读全文
posted @ 2015-06-29 08:14 Grandyang 阅读(24710) 评论(2) 推荐(2) 编辑
Fork me on GitHub