摘要:
Given a circular array C of integers represented by A, find the maximum possible sum of a non-empty subarray of C. Here, a circular array means the en 阅读全文
摘要:
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
摘要:
Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: Output 阅读全文
摘要:
Given an array A of positive integers, call a (contiguous, not necessarily distinct) subarray of A good if the number of different integers in that su 阅读全文
摘要:
On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; D 阅读全文
摘要:
Given an array equations of strings that represent relationships between variables, each string equations[i] has length 4 and takes one of two differe 阅读全文
摘要:
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 [ 阅读全文
摘要:
Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th 阅读全文
摘要:
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
摘要:
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th 阅读全文