上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 思路 阅读全文
posted @ 2016-09-28 03:41 Machelsky 阅读(115) 评论(0) 推荐(0)
摘要: Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 阅读全文
posted @ 2016-09-28 02:02 Machelsky 阅读(208) 评论(0) 推荐(0)
摘要: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2016-09-28 01:45 Machelsky 阅读(125) 评论(0) 推荐(0)
摘要: You are playing the following Flip Game with your friend: Given a string that contains only these two characters: +and -, you and your friend take tur 阅读全文
posted @ 2016-09-27 16:23 Machelsky 阅读(105) 评论(0) 推荐(0)
摘要: Given a string, determine if a permutation of the string could form a palindrome. For example,"code" -> False, "aab" -> True, "carerac" -> True. 思路:ha 阅读全文
posted @ 2016-09-27 15:22 Machelsky 阅读(174) 评论(0) 推荐(0)
摘要: Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Example 1: Given 阅读全文
posted @ 2016-09-27 14:51 Machelsky 阅读(148) 评论(0) 推荐(0)
摘要: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 阅读全文
posted @ 2016-09-27 14:10 Machelsky 阅读(130) 评论(0) 推荐(0)
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2016-09-27 11:41 Machelsky 阅读(163) 评论(0) 推荐(0)
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2016-09-25 08:43 Machelsky 阅读(106) 评论(0) 推荐(0)
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2016-09-25 06:47 Machelsky 阅读(113) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页