上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 64 下一页
摘要: You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array. Return the minimum 阅读全文
posted @ 2021-01-23 11:55 CNoodle 阅读(273) 评论(0) 推荐(0)
摘要: We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[index] 阅读全文
posted @ 2021-01-23 01:11 CNoodle 阅读(76) 评论(0) 推荐(0)
摘要: Given two integers a and b, return any string s such that: s has length a + b and contains exactly a 'a' letters, and exactly b 'b' letters, The subst 阅读全文
posted @ 2021-01-19 01:39 CNoodle 阅读(207) 评论(0) 推荐(0)
摘要: A string s is called happy if it satisfies the following conditions: s only contains the letters 'a', 'b', and 'c'. s does not contain any of "aaa", " 阅读全文
posted @ 2021-01-19 00:56 CNoodle 阅读(844) 评论(0) 推荐(0)
摘要: You are given an integer n. An array nums of length n + 1 is generated in the following way: nums[0] = 0 nums[1] = 1 nums[2 * i] = nums[i] when 2 <= 2 阅读全文
posted @ 2021-01-17 07:24 CNoodle 阅读(163) 评论(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 @ 2021-01-17 06:08 CNoodle 阅读(91) 评论(0) 推荐(0)
摘要: You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array num 阅读全文
posted @ 2021-01-16 01:41 CNoodle 阅读(592) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2021-01-15 15:27 CNoodle 阅读(170) 评论(0) 推荐(0)
摘要: You are given an array of characters letters that is sorted in non-decreasing order, and a character target. There are at least two different characte 阅读全文
posted @ 2021-01-14 03:30 CNoodle 阅读(173) 评论(0) 推荐(0)
摘要: Given an array of integers arr and an integer k. A value arr[i] is said to be stronger than a value arr[j] if |arr[i] - m| > |arr[j] - m| where m is t 阅读全文
posted @ 2021-01-14 03:04 CNoodle 阅读(168) 评论(0) 推荐(0)
摘要: 二分法是算法题里面一个比较基础但是很容易错的概念,一开始练习的时候由于不熟悉二分法的套路,反复出现死循环或者目标值找错,非常影响做题心情。我总结了如下几个模板。原则上这里的模板无论你使用哪一个,都可以解决二分法类型的问题,只不过有一些题目,比如寻找一个最大值/最小值的,可能某一个模板更适合,需要判断 阅读全文
posted @ 2021-01-12 17:14 CNoodle 阅读(2301) 评论(0) 推荐(0)
摘要: Given a non-negative integer c, decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Input: c = 5 Output: true Explanation: 阅读全文
posted @ 2021-01-12 06:57 CNoodle 阅读(129) 评论(0) 推荐(0)
摘要: You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you get by erasing the subarray is 阅读全文
posted @ 2021-01-08 01:05 CNoodle 阅读(438) 评论(0) 推荐(0)
摘要: Given a string s, return the maximum number of unique substrings that the given string can be split into. You can split string s into any list of non- 阅读全文
posted @ 2021-01-07 01:36 CNoodle 阅读(333) 评论(0) 推荐(0)
摘要: You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equa 阅读全文
posted @ 2021-01-06 07:29 CNoodle 阅读(341) 评论(0) 推荐(0)
摘要: Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's. Example 1: Input: 阅读全文
posted @ 2021-01-06 01:56 CNoodle 阅读(194) 评论(0) 推荐(0)
摘要: Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0. Example 1: Input: [1,0,1,1,0] Output: 4 E 阅读全文
posted @ 2021-01-06 01:14 CNoodle 阅读(191) 评论(0) 推荐(0)
摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two di 阅读全文
posted @ 2021-01-05 14:08 CNoodle 阅读(163) 评论(0) 推荐(0)
摘要: In a string s of lowercase letters, these letters form consecutive groups of the same character. For example, a string like s = "abbxxxxzyy" has the g 阅读全文
posted @ 2021-01-05 02:24 CNoodle 阅读(146) 评论(0) 推荐(0)
摘要: Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every 阅读全文
posted @ 2021-01-05 01:02 CNoodle 阅读(130) 评论(0) 推荐(0)
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 64 下一页