06 2016 档案
摘要:There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every
阅读全文
摘要:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r
阅读全文
摘要:Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assum
阅读全文
摘要:79. Word Search 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 ce
阅读全文
摘要:54. Spiral Matrix Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the follo
阅读全文
摘要:341. Flatten Nested List Iterator Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -
阅读全文
摘要:146. LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get
阅读全文
摘要:10. Regular Expression Matching Implement regular expression matching with support for '.' and '*'. 44. Wildcard Matching 44. Wildcard Matching Implem
阅读全文
摘要:4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The
阅读全文
摘要: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
阅读全文
摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Given a non-negative integer n, count all numbers with uni
阅读全文
摘要:Additive number is a string whose digits can form additive sequence. Additive number is a string whose digits can form additive sequence. A valid addi
阅读全文
摘要:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. Given two integers representing the
阅读全文
39. Combination Sum && 40. Combination Sum II && 216. Combination Sum III && 377. Combination Sum IV
摘要:39. Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums t
阅读全文
摘要:Given an array of strings, group anagrams together. Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate
阅读全文
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia
阅读全文
摘要:200. Number of Islands Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is forme
阅读全文
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee
阅读全文
摘要:231. Power ofTwo Given an integer, write a function to determine if it is a power of two. Hide Similar Problems (E) Number of 1 Bits (E) Power of Thre
阅读全文
摘要:280. Wiggle Sort Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3
阅读全文
摘要:215. Kth Largest Element in an Array Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, n
阅读全文
摘要:Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc
阅读全文
摘要:Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if
阅读全文

浙公网安备 33010602011771号