上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 64 下一页
摘要: Given an array of integers arr and an integer k. Find the least number of unique integers after removing exactly k elements. Example 1: Input: arr = [ 阅读全文
posted @ 2021-03-12 15:32 CNoodle 阅读(436) 评论(0) 推荐(0)
摘要: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2021-03-12 01:38 CNoodle 阅读(68) 评论(0) 推荐(0)
摘要: Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together in any place in the array. Examp 阅读全文
posted @ 2021-03-11 03:04 CNoodle 阅读(875) 评论(0) 推荐(0)
摘要: Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth. Note that the root node is 阅读全文
posted @ 2021-03-10 03:37 CNoodle 阅读(62) 评论(0) 推荐(0)
摘要: Given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s. Return the minimum number 阅读全文
posted @ 2021-03-09 14:45 CNoodle 阅读(253) 评论(0) 推荐(0)
摘要: Given an integer array nums and a positive integer k, return the most competitive subsequence of nums of size k. An array's subsequence is a resulting 阅读全文
posted @ 2021-03-09 01:03 CNoodle 阅读(313) 评论(0) 推荐(0)
摘要: Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. Return the 阅读全文
posted @ 2021-03-08 23:51 CNoodle 阅读(529) 评论(0) 推荐(0)
摘要: There is a special keyboard with all keys in a single row. Given a string keyboard of length 26 indicating the layout of the keyboard (indexed from 0 阅读全文
posted @ 2021-03-07 12:08 CNoodle 阅读(283) 评论(0) 推荐(0)
摘要: You would like to make dessert and are preparing to buy the ingredients. You have n ice cream base flavors and m types of toppings to choose from. You 阅读全文
posted @ 2021-03-07 05:53 CNoodle 阅读(272) 评论(0) 推荐(0)
摘要: You are given a 2D array of integers envelopes where envelopes[i] = [wi, hi] represents the width and the height of an envelope. One envelope can fit 阅读全文
posted @ 2021-03-05 12:57 CNoodle 阅读(637) 评论(0) 推荐(0)
摘要: You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward i 阅读全文
posted @ 2021-03-04 03:00 CNoodle 阅读(475) 评论(0) 推荐(0)
摘要: You are given a string s and two integers x and y. You can perform two types of operations any number of times. Remove substring "ab" and gain x point 阅读全文
posted @ 2021-03-04 01:49 CNoodle 阅读(386) 评论(0) 推荐(0)
摘要: Given a string s, we make queries on substrings of s. For each query queries[i] = [left, right, k], we may rearrange the substring s[left], ..., s[rig 阅读全文
posted @ 2021-03-03 05:12 CNoodle 阅读(94) 评论(0) 推荐(0)
摘要: You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got dup 阅读全文
posted @ 2021-03-03 03:45 CNoodle 阅读(169) 评论(0) 推荐(0)
摘要: Given a 2D matrix matrix, handle multiple queries of the following type: Calculate the sum of the elements of matrix inside the rectangle defined by i 阅读全文
posted @ 2021-03-02 01:20 CNoodle 阅读(270) 评论(0) 推荐(0)
摘要: Implement FreqStack, a class which simulates the operation of a stack-like data structure. FreqStack has two functions: push(int x), which pushes an i 阅读全文
posted @ 2021-03-01 15:37 CNoodle 阅读(171) 评论(0) 推荐(0)
摘要: Given an integer array nums, handle multiple queries of the following type: Calculate the sum of the elements of nums between indices left and right i 阅读全文
posted @ 2021-03-01 13:39 CNoodle 阅读(193) 评论(0) 推荐(0)
摘要: Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop o 阅读全文
posted @ 2021-02-28 08:28 CNoodle 阅读(122) 评论(0) 推荐(0)
摘要: An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. A 阅读全文
posted @ 2021-02-28 07:29 CNoodle 阅读(102) 评论(0) 推荐(0)
摘要: There are n buildings in a line. You are given an integer array heights of size n that represents the heights of the buildings in the line. The ocean 阅读全文
posted @ 2021-02-27 00:53 CNoodle 阅读(2140) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 64 下一页