摘要: 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 阅读全文
posted @ 2019-02-12 15:43 yuxihong 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-11 11:45 yuxihong 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-11 11:21 yuxihong 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-10 22:43 yuxihong 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-10 20:14 yuxihong 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Given an array equations of strings that represent relationships between variables, each string equations[i] has length 4 and takes one of two differe 阅读全文
posted @ 2019-02-10 19:06 yuxihong 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 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 [ 阅读全文
posted @ 2019-02-10 17:46 yuxihong 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-08 01:11 yuxihong 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-07 08:08 yuxihong 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-07 05:08 yuxihong 阅读(85) 评论(0) 推荐(0) 编辑