随笔分类 -  Leetcode

上一页 1 2 3 4 5 6 7 8 ··· 23 下一页
摘要:Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th 阅读全文
posted @ 2019-04-25 22:12 Veritas_des_Liberty 阅读(227) 评论(0) 推荐(0) 编辑
摘要:Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is 阅读全文
posted @ 2019-04-23 12:46 Veritas_des_Liberty 阅读(315) 评论(0) 推荐(0) 编辑
摘要:Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha 阅读全文
posted @ 2019-04-23 12:06 Veritas_des_Liberty 阅读(189) 评论(0) 推荐(0) 编辑
摘要:Given an integer n, find the closest integer (not including itself), which is a palindrome. The 'closest' is defined as absolute difference minimized 阅读全文
posted @ 2019-04-22 22:32 Veritas_des_Liberty 阅读(267) 评论(0) 推荐(0) 编辑
摘要:Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is gre 阅读全文
posted @ 2019-04-22 21:37 Veritas_des_Liberty 阅读(270) 评论(0) 推荐(0) 编辑
摘要:Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any 阅读全文
posted @ 2019-04-20 22:12 Veritas_des_Liberty 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Given a nested list of integers represented as a string, implement a parser to deserialize it. Each element is either an integer, or a list -- whose e 阅读全文
posted @ 2019-04-16 17:40 Veritas_des_Liberty 阅读(286) 评论(0) 推荐(0) 编辑
摘要:Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. Example 1: Input: 123 Output: " 阅读全文
posted @ 2019-04-16 11:21 Veritas_des_Liberty 阅读(163) 评论(0) 推荐(0) 编辑
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators a 阅读全文
posted @ 2019-04-15 21:21 Veritas_des_Liberty 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f 阅读全文
posted @ 2019-04-15 19:14 Veritas_des_Liberty 阅读(166) 评论(0) 推荐(0) 编辑
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, w 阅读全文
posted @ 2019-04-15 14:40 Veritas_des_Liberty 阅读(155) 评论(0) 推荐(0) 编辑
摘要:1025. Divisor Game Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the chalkboard. On each playe 阅读全文
posted @ 2019-04-14 17:50 Veritas_des_Liberty 阅读(309) 评论(0) 推荐(0) 编辑
摘要:In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino. (A domino is a tile with two numbers from 1 to 6 - one on 阅读全文
posted @ 2019-04-13 12:27 Veritas_des_Liberty 阅读(443) 评论(0) 推荐(0) 编辑
摘要:Given an array A of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (including d 阅读全文
posted @ 2019-04-13 11:27 Veritas_des_Liberty 阅读(263) 评论(0) 推荐(0) 编辑
摘要:Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. Example 1: Note: Approach #1: Has 阅读全文
posted @ 2019-04-12 22:00 Veritas_des_Liberty 阅读(435) 评论(0) 推荐(0) 编辑
摘要:A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), followed by some number of '1's (also possibly 0. 阅读全文
posted @ 2019-04-12 21:19 Veritas_des_Liberty 阅读(298) 评论(0) 推荐(0) 编辑
摘要: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-04-11 22:33 Veritas_des_Liberty 阅读(252) 评论(0) 推荐(0) 编辑
摘要:In a deck of cards, each card has an integer written on it. Return true if and only if you can choose X >= 2 such that it is possible to split the ent 阅读全文
posted @ 2019-04-11 21:29 Veritas_des_Liberty 阅读(337) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers A, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, return the 阅读全文
posted @ 2019-04-11 18:11 Veritas_des_Liberty 阅读(368) 评论(0) 推荐(0) 编辑
摘要:Write an iterator that iterates through a run-length encoded sequence. The iterator is initialized by RLEIterator(int[] A), where A is a run-length en 阅读全文
posted @ 2019-04-10 22:14 Veritas_des_Liberty 阅读(225) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 23 下一页