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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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:
阅读全文
摘要: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
阅读全文
摘要: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 = [
阅读全文
摘要: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,
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号