随笔分类 -  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 阅读全文
posted @ 2022-09-25 16:07 onlyblues 阅读(73) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-09-19 20:43 onlyblues 阅读(85) 评论(0) 推荐(0)
摘要:Minimum Money Required Before Transactions You are given a 0-indexed 2D integer array transactions , where transactions[i] = [costi, cashbacki] . The 阅读全文
posted @ 2022-09-19 19:44 onlyblues 阅读(45) 评论(0) 推荐(0)
摘要: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$ 阅读全文
posted @ 2022-09-18 19:36 onlyblues 阅读(69) 评论(0) 推荐(0)
摘要:最长上升子序列 给定一个长度为 $N$ 的数列,求数值严格单调递增的子序列的长度最长是多少。 输入格式 第一行包含整数 $N$。 第二行包含 $N$ 个整数,表示完整序列。 输出格式 输出一个整数,表示最大长度。 数据范围 $1 \leq N \leq 1000$,${−10}^{9} \leq \ 阅读全文
posted @ 2022-09-13 16:24 onlyblues 阅读(1182) 评论(0) 推荐(0)
摘要: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] 阅读全文
posted @ 2022-09-07 21:23 onlyblues 阅读(30) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-09-06 16:16 onlyblues 阅读(120) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-09-05 23:19 onlyblues 阅读(110) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-09-05 20:16 onlyblues 阅读(92) 评论(0) 推荐(0)
摘要:Maximum Number of Robots Within Budget You have $n$ robots. You are given two 0-indexed integer arrays, chargeTimes and runningCosts , both of length 阅读全文
posted @ 2022-09-04 21:47 onlyblues 阅读(64) 评论(0) 推荐(0)
摘要:Subarray With Elements Greater Than Varying Threshold You are given an integer array $nums$ and an integer $threshold$. Find any subarray of $nums$ of 阅读全文
posted @ 2022-08-29 20:19 onlyblues 阅读(62) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-08-28 15:41 onlyblues 阅读(98) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-08-21 22:00 onlyblues 阅读(42) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2022-08-21 19:07 onlyblues 阅读(86) 评论(0) 推荐(0)
摘要: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 . 阅读全文
posted @ 2022-08-21 16:19 onlyblues 阅读(76) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-08-15 21:31 onlyblues 阅读(61) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-08-15 16:59 onlyblues 阅读(109) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-08-15 12:45 onlyblues 阅读(52) 评论(0) 推荐(0)

Web Analytics