07 2023 档案
摘要:You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with pla
阅读全文
摘要:You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n tr
阅读全文
摘要:You are given a stream of points on the X-Y plane. Design an algorithm that: Adds new points from the stream into a data structure. Duplicate points a
阅读全文
摘要:You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Not
阅读全文
摘要:Given an integer n, return a list of all possible full binary trees with n nodes. Each node of each tree in the answer must have Node.val == 0. Each e
阅读全文
摘要:You are given a 0-indexed integer array nums of length n. You are initially standing at index 0. You can jump from index i to index j where i < j if:
阅读全文
摘要:You are given n tables represented with two arrays names and columns, where names[i] is the name of the ith table and columns[i] is the number of colu
阅读全文
摘要:You have a keypad with 9 buttons, numbered from 1 to 9, each mapped to lowercase English letters. You can choose which characters each button is match
阅读全文
摘要:You are given two 0-indexed integer arrays jobs and workers of equal length, where jobs[i] is the amount of time needed to complete the ith job, and w
阅读全文
摘要:You are given a 0-indexed string s consisting of only lowercase English letters. In one operation, you can change any character of s to any other char
阅读全文
摘要:You are given a 0-indexed integer array nums. Swaps of adjacent elements are able to be performed on nums. A valid array meets the following condition
阅读全文
摘要:You are given an array nums consisting of positive integers. You can perform the following operation on the array any number of times: Choose any two
阅读全文
摘要:Given the root of a binary tree and an array of TreeNode objects nodes, return the lowest common ancestor (LCA) of all the nodes in nodes. All the nod
阅读全文
摘要:You are given two strings s and t consisting of only lowercase English letters. Return the minimum number of characters that need to be appended to th
阅读全文
摘要:You are given an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that meet the following conditions: T
阅读全文
摘要:You are given a 0-indexed binary string s which represents the types of buildings along a street where: s[i] = '0' denotes that the ith building is an
阅读全文
摘要:A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot can receive a sequence of these three possible types of commands: -2: T
阅读全文
摘要:You are given an array nums of positive integers and a positive integer k. A subset of nums is beautiful if it does not contain two integers with an a
阅读全文
摘要:You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (in
阅读全文
摘要:Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that th
阅读全文
摘要:You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You must choose a subsequence of indices from n
阅读全文
摘要:Given an n x n array of integers matrix, return the minimum sum of any falling path through matrix. A falling path starts at any element in the first
阅读全文
摘要:A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing
阅读全文
摘要:You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers. For example, given finalSum = 12, the fol
阅读全文
摘要:There is a bag that consists of items, each item has a number 1, 0, or -1 written on it. You are given four non-negative integers numOnes, numZeros, n
阅读全文
摘要:You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty: From eac
阅读全文

浙公网安备 33010602011771号