摘要:
For a non-negative integer X, the array-form of X is an array of its digits in left to right order. For example, if X = 1231, then the array form is [ 阅读全文
摘要:
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding one 阅读全文
摘要:
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
摘要:
Given an array A of positive integers, A[i] represents the value of the i-th sightseeing spot, and two sightseeing spots i and j have distance j - i b 阅读全文
摘要:
Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant-bit to least-si 阅读全文
摘要:
Given an array A, partition it into two (contiguous) subarrays left and right so that: Every element in left is less than or equal to every element in 阅读全文
摘要:
Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both 阅读全文
摘要:
Given an array A of integers, return true if and only if we can partition the array into three non-empty parts with equal sums. Formally, we can parti 阅读全文
摘要:
Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
摘要:
Design and implement a TwoSum class. It should support the following operations:add and find. add - Add the number to an internal data structure.find 阅读全文