随笔分类 -  Snapchat

摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Clarification Your algorithm should run in O(n) com 阅读全文
posted @ 2016-07-05 01:48 北叶青藤 阅读(185) 评论(0) 推荐(0)
摘要:Two Sum I Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of 阅读全文
posted @ 2016-07-04 07:13 北叶青藤 阅读(326) 评论(0) 推荐(0)
摘要:Given an integers array A. Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B WITHOUT divide operation. Example For A = [1, 2, 3], 阅读全文
posted @ 2016-07-01 11:05 北叶青藤 阅读(373) 评论(0) 推荐(0)
摘要:560. Subarray Sum Equals K Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to  阅读全文
posted @ 2016-07-01 07:57 北叶青藤 阅读(228) 评论(0) 推荐(0)
摘要:Majority Number Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find it. Example Gi 阅读全文
posted @ 2016-06-29 22:58 北叶青藤 阅读(395) 评论(0) 推荐(0)
摘要:Word Search I Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell 阅读全文
posted @ 2016-06-29 03:13 北叶青藤 阅读(313) 评论(0) 推荐(0)
摘要:Word Break I Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionar 阅读全文
posted @ 2015-01-26 05:49 北叶青藤 阅读(249) 评论(0) 推荐(0)
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: " 阅读全文
posted @ 2015-01-02 07:16 北叶青藤 阅读(191) 评论(0) 推荐(0)