02 2016 档案
摘要:Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct
阅读全文
摘要:Maximal Square Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given th
阅读全文
摘要:Perfect Squares Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For exampl
阅读全文
摘要:Count Prime Description: Count the number of prime numbers less than a non-negative number, n. https://leetcode.com/problems/count-primes/ 找出所有小于n的数中的
阅读全文
摘要:Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any po
阅读全文
摘要:Count of Smaller Numbers After Self You are given an integer array nums and you have to return a new counts array. The counts array has the property w
阅读全文
摘要:Patching Array Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclu
阅读全文
摘要:Self Crossing You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the wes
阅读全文
摘要:Increasing Triplet Subsequence Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the f
阅读全文
摘要:Reconstruct Itinerary Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in
阅读全文
摘要:Verify Preorder Serialization of a Binary Tree One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we
阅读全文
摘要:Odd Even Linked List Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the no
阅读全文
摘要:Power of Three Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it without using any loop / recursion
阅读全文
摘要:Longest Increasing Path in a Matrix Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to fo
阅读全文

浙公网安备 33010602011771号