随笔分类 -  LeetCode

摘要:Minimum Edge Weight Equilibrium Queries in a Tree There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 阅读全文
posted @ 2023-09-04 16:28 onlyblues 阅读(80) 评论(0) 推荐(0)
摘要:Number of Beautiful Integers in the Range You are given positive integers low, high, and k. A number is beautiful if it meets both of the following co 阅读全文
posted @ 2023-08-20 16:31 onlyblues 阅读(71) 评论(0) 推荐(0)
摘要:Count of Integers You are given two numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x to be good if: num1 <= 阅读全文
posted @ 2023-06-04 16:44 onlyblues 阅读(29) 评论(0) 推荐(0)
摘要:Maximum Strictly Increasing Cells in a Matrix Given a 1-indexed m x n integer matrix mat, you can select any cell in the matrix as your starting cell. 阅读全文
posted @ 2023-06-02 16:11 onlyblues 阅读(87) 评论(0) 推荐(0)
摘要:Minimum Number of Visited Cells in a Grid You are given a 0-indexed m x n integer matrix grid . Your initial position is at the top-left cell (0, 0). 阅读全文
posted @ 2023-04-16 21:37 onlyblues 阅读(114) 评论(0) 推荐(0)
摘要:Minimum Reverse Operations You are given an integer n and an integer p in the range [0, n - 1]. Representing a 0-indexed array arr of length n where a 阅读全文
posted @ 2023-04-15 15:00 onlyblues 阅读(59) 评论(0) 推荐(0)
摘要:Shortest Cycle in a Graph There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1. The edges in the graph are re 阅读全文
posted @ 2023-04-14 17:52 onlyblues 阅读(80) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-19 19:41 onlyblues 阅读(169) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-19 18:53 onlyblues 阅读(232) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-19 10:16 onlyblues 阅读(28) 评论(0) 推荐(0)
摘要:Subsequence With the Minimum Score You are given two strings $s$ and $t$ . You are allowed to remove any number of characters from the string t. The s 阅读全文
posted @ 2023-02-12 22:54 onlyblues 阅读(37) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-12 15:49 onlyblues 阅读(48) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-12 15:28 onlyblues 阅读(86) 评论(0) 推荐(0)
摘要:Disconnect Path in a Binary Matrix by at Most One Flip You are given a 0-indexed $m \times n$ binary matrix grid . You can move from a cell (row, col) 阅读全文
posted @ 2023-02-05 18:16 onlyblues 阅读(85) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-05 16:08 onlyblues 阅读(35) 评论(0) 推荐(0)
摘要:Minimum Cost to Make Array Equal You are given two 0-indexed arrays nums and cost consisting each of $n$ positive integers. You can do the following o 阅读全文
posted @ 2023-02-02 23:12 onlyblues 阅读(93) 评论(0) 推荐(0)
摘要:Count Increasing Quadruplets Given a 0-indexed integer array nums of size $n$ containing all numbers from $1$ to $n$, return the number of increasing 阅读全文
posted @ 2023-02-02 19:36 onlyblues 阅读(54) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-02-01 18:00 onlyblues 阅读(90) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-01-25 16:47 onlyblues 阅读(78) 评论(0) 推荐(0)
摘要:Minimum Cost to Split an Array You are given an integer array nums and an integer $k$. Split the array into some number of non-empty subarrays. The co 阅读全文
posted @ 2023-01-22 12:51 onlyblues 阅读(52) 评论(0) 推荐(0)

Web Analytics