03 2021 档案

摘要:Given an m x n matrix mat where every row is sorted in strictly increasing order, return the smallest common element in all rows. If there is no commo 阅读全文
posted @ 2021-03-28 13:30 CNoodle 阅读(761) 评论(0) 推荐(0)
摘要:You are given an integer length and an array updates where updates[i] = [startIdxi, endIdxi, inci]. You have an array arr of length length with all ze 阅读全文
posted @ 2021-03-28 12:16 CNoodle 阅读(306) 评论(0) 推荐(0)
摘要:You are given an integer array nums. The absolute sum of a subarray [numsl, numsl+1, ..., numsr-1, numsr] is abs(numsl + numsl+1 + ... + numsr-1 + num 阅读全文
posted @ 2021-03-25 14:27 CNoodle 阅读(252) 评论(0) 推荐(0)
摘要:You are given a 2D integer array orders, where each orders[i] = [price, amount, orderType] denotes that amount orders have been placed of type orderTy 阅读全文
posted @ 2021-03-22 15:23 CNoodle 阅读(136) 评论(0) 推荐(0)
摘要:Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leading digit is not zero. Return  阅读全文
posted @ 2021-03-22 06:17 CNoodle 阅读(74) 评论(0) 推荐(0)
摘要:There are n rooms labeled from 0 to n - 1 and all the rooms are locked except for room 0. Your goal is to visit all the rooms. However, you cannot ent 阅读全文
posted @ 2021-03-21 02:44 CNoodle 阅读(98) 评论(0) 推荐(0)
摘要:Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for 阅读全文
posted @ 2021-03-20 05:23 CNoodle 阅读(366) 评论(0) 推荐(0)
摘要:You are given an integer num. You can swap two digits at most once to get the maximum valued number. Return the maximum valued number you can get. Exa 阅读全文
posted @ 2021-03-18 00:29 CNoodle 阅读(108) 评论(0) 推荐(0)
摘要:You are given the head of a linked list, and an integer k. Return the head of the linked list after swapping the values of the kth node from the begin 阅读全文
posted @ 2021-03-17 05:58 CNoodle 阅读(320) 评论(0) 推荐(0)
摘要:Given two strings s and t, return the number of distinct subsequences of s which equals t. A string's subsequence is a new string formed from the orig 阅读全文
posted @ 2021-03-17 02:35 CNoodle 阅读(450) 评论(0) 推荐(0)
摘要:Assume the following rules are for the tic-tac-toe game on an n x n board between two players: A move is guaranteed to be valid and is placed on an em 阅读全文
posted @ 2021-03-15 06:33 CNoodle 阅读(431) 评论(0) 推荐(0)
摘要:Given a binary string s and an integer k. Return True if every binary code of length k is a substring of s. Otherwise, return False. Example 1: Input: 阅读全文
posted @ 2021-03-14 03:08 CNoodle 阅读(214) 评论(0) 推荐(0)
摘要:Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the pos 阅读全文
posted @ 2021-03-14 01:40 CNoodle 阅读(242) 评论(0) 推荐(0)
摘要: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 阅读(449) 评论(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 阅读(71) 评论(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 阅读(889) 评论(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 阅读(72) 评论(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 阅读(261) 评论(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 阅读(324) 评论(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 阅读(541) 评论(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 阅读(296) 评论(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 阅读(279) 评论(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 阅读(652) 评论(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 阅读(489) 评论(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 阅读(393) 评论(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 阅读(105) 评论(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 阅读(181) 评论(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 阅读(278) 评论(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 阅读(176) 评论(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 阅读(205) 评论(0) 推荐(0)