随笔分类 - LeetCode
摘要:Longest Subarray With Maximum Bitwise AND You are given an integer array nums of size $n$. Consider a non-empty subarray from nums that has the maximu
阅读全文
摘要:Sum of Prefix Scores of Strings You are given an array words of sizeco $n$ sisting of non-empty strings. We define the score of a string word as the n
阅读全文
摘要:Minimum Money Required Before Transactions You are given a 0-indexed 2D integer array transactions , where transactions[i] = [costi, cashbacki] . The
阅读全文
摘要:Smallest Subarrays With Maximum Bitwise OR You are given a 0-indexed array nums of length $n$, consisting of non-negative integers. For each index $i$
阅读全文
摘要:最长上升子序列 给定一个长度为 $N$ 的数列,求数值严格单调递增的子序列的长度最长是多少。 输入格式 第一行包含整数 $N$。 第二行包含 $N$ 个整数,表示完整序列。 输出格式 输出一个整数,表示最大长度。 数据范围 $1 \leq N \leq 1000$,${−10}^{9} \leq \
阅读全文
摘要:Evaluate Division You are given an array of variable pairs equations and an array of real numbers values , where equations[i] = [Ai, Bi] and values[i]
阅读全文
摘要:Count Unique Characters of All Substrings of a Given String Let's define a function countUniqueChars(s) that returns the number of unique characters o
阅读全文
摘要:Meeting Rooms III You are given an integer $n$. There are $n$ rooms numbered from $0$ to $n - 1$. You are given a 2D integer array meetings where meet
阅读全文
摘要:Number of Ways to Reach a Position After Exactly k Steps You are given two positive integers startPos and endPos . Initially, you are standing at posi
阅读全文
摘要:Maximum Number of Robots Within Budget You have $n$ robots. You are given two 0-indexed integer arrays, chargeTimes and runningCosts , both of length
阅读全文
摘要:Subarray With Elements Greater Than Varying Threshold You are given an integer array $nums$ and an integer $threshold$. Find any subarray of $nums$ of
阅读全文
摘要:Build a Matrix With Conditions You are given a positive integer $k$. You are also given: a 2D integer array $rowConditions$ of size $n$ where $rowCond
阅读全文
摘要:Largest Palindromic Number You are given a string $num$ consisting of digits only. Return the largest palindromic integer (in the form of a string) th
阅读全文
摘要:Maximum Segment Sum After Removals You are given two 0-indexed integer arrays $nums$ and $removeQueries$, both of length $n$. For the $i^{th}$ query,
阅读全文
摘要:Time Needed to Rearrange a Binary String You are given a binary string $s$. In one second, all occurrences of 01 are simultaneously replaced with 10 .
阅读全文
摘要:Count Special Integers We call a positive integer special if all of its digits are distinct. Given a positive integer $n$, return the number of specia
阅读全文
摘要:Construct Smallest Number From DI String You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and
阅读全文
摘要:Max Chunks To Make Sorted II You are given an integer array arr. We split arr into some number of chunks (i.e., partitions), and individually sort eac
阅读全文

浙公网安备 33010602011771号