随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要: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],
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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: "
阅读全文

浙公网安备 33010602011771号