随笔分类 - LeetCode
摘要:Check If Digits Are Equal in String After Operations II You are given a string s consisting of digits. Perform the following operation repeatedly unti
阅读全文
摘要:Maximum Difference Between Even and Odd Frequency II You are given a string s and an integer k. Your task is to find the maximum difference between th
阅读全文
摘要:Minimum Operations to Make Character Frequencies Equal You are given a string s. A string t is called good if all characters of t occur the same numbe
阅读全文
摘要:Maximum Area Rectangle With Point Constraints II There are n points on an infinite plane. You are given two integer arrays xCoord and yCoord where (xC
阅读全文
摘要:Find Products of Elements of Big Array A powerful array for an integer x is the shortest sorted array of powers of two that sum up to x. For example,
阅读全文
摘要:Find All Possible Stable Binary Arrays II You are given 3 positive integers zero, one, and limit. A binary array arr is called stable if: The number o
阅读全文
摘要:Count Valid Paths in a Tree There is an undirected tree with n nodes labeled from 1 to n. You are given the integer n and a 2D integer array edges of
阅读全文
摘要:Minimize OR of Remaining Elements Using Operations You are given a 0-indexed integer array nums and an integer k. In one operation, you can pick any i
阅读全文
摘要:Count Beautiful Substrings II You are given a string s and a positive integer k. Let vowels and consonants be the number of vowels and consonants in a
阅读全文
摘要:Make Lexicographically Smallest Array by Swapping Elements You are given a 0-indexed array of positive integers nums and a positive integer limit. In
阅读全文
摘要:Minimum Changes to Make K Semi-palindromes Given a string s and an integer k, partition s into k substrings such that the sum of the number of letter
阅读全文
摘要:Count of Sub-Multisets With Bounded Sum You are given a 0-indexed array nums of non-negative integers, and two integers l and r. Return the count of s
阅读全文
摘要:String Transformation You are given two strings s and t of equal length n. You can perform the following operation on the string s: Remove a suffix of
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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 <=
阅读全文
摘要: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.
阅读全文
摘要: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).
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文