随笔分类 - LeetCode
摘要:The Number of Good Subsets You are given an integer array nums . We call a subset of nums good if its product can be represented as a product of one o
阅读全文
摘要:Count the Number of Square-Free Subsets You are given a positive integer 0-indexed array nums . A subset of the array nums is square-free if the produ
阅读全文
摘要:Handling Sum Queries After Update You are given two 0-indexed arrays nums1 and nums2 and a 2D array queries of queries. There are three types of queri
阅读全文
摘要:Subsequence With the Minimum Score You are given two strings and . You are allowed to remove any number of characters from the string t. The s
阅读全文
摘要:Substring XOR Queries You are given a binary string s , and a 2D integer array queries where queries[i] = [firsti, secondi] . For the ith query, find
阅读全文
摘要:Count the Number of Fair Pairs Given a 0-indexed integer array nums of size n and two integers lower and upper , return the number of fair pairs. A pa
阅读全文
摘要:Disconnect Path in a Binary Matrix by at Most One Flip You are given a 0-indexed binary matrix grid . You can move from a cell (row, col)
阅读全文
摘要:Maximize Win From Two Segments There are some prizes on the X-axis. You are given an integer array prizePositions that is sorted in non-decreasing ord
阅读全文
摘要:Minimum Cost to Make Array Equal You are given two 0-indexed arrays nums and cost consisting each of positive integers. You can do the following o
阅读全文
摘要:Count Increasing Quadruplets Given a 0-indexed integer array nums of size containing all numbers from to , return the number of increasing
阅读全文
摘要:Put Marbles in Bags You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also gi
阅读全文
摘要:Rank Transform of a Matrix Given an m x n matrix , return a new matrix answer where answer[row][col] is the rank of matrix[row][col] . The rank is an
阅读全文
摘要:Minimum Cost to Split an Array You are given an integer array nums and an integer . Split the array into some number of non-empty subarrays. The co
阅读全文
摘要:Difference Between Maximum and Minimum Price Sum There exists an undirected and initially unrooted tree with nodes indexed from to . Yo
阅读全文
摘要:Maximize the Minimum Powered City You are given a 0-indexed integer array stations of length , where stations[i] represents the number of power sta
阅读全文
摘要:Number of Great Partitions You are given an array nums consisting of positive integers and an integer k . Partition the array into two ordered groups
阅读全文
摘要:Count Pairs With XOR in a Range Given a (0-indexed) integer array nums and two integers low and high , return the number of nice pairs. A nice pair is
阅读全文
摘要:Maximum Number of Points From Grid Queries You are given an integer matrix grid and an array queries of size . Find an array answer of
阅读全文
摘要:Frog Jump II You are given a 0-indexed integer array stones sorted in strictly increasing order representing the positions of stones in a river. A fro
阅读全文
摘要:Add Edges to Make Degrees of All Nodes Even There is an undirected graph consisting of nodes numbered from to . You are given the integer $
阅读全文