2209. Minimum White Tiles After Covering With Carpets
Problem You are given a 0-indexed binary string floor, which represents the colors of tiles on a floor: floor[i] = '0' denot...
Problem You are given a 0-indexed binary string floor, which represents the colors of tiles on a floor: floor[i] = '0' denot...
Problem A game is played by a cat and a mouse named Cat and Mouse. The environment is represented by a grid of size rows x co...
Problem You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the la...
Problem You are given a 0-indexed 2D integer array transactions, where transactions[i] = [costᵢ, cashbackᵢ]. The array descri...
Problem There exists an undirected tree rooted at node 0 with n nodes labeled from 0 to n - 1. You are given a 2D integer arr...
Problem There are n piles of coins on a table. Each pile consists of a positive number of coins of assorted denominations. In...
Problem Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water ...
Problem Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently...
Problem You are given a 2D integer array intervals, where intervals[i] = [lᵢ, rᵢ, weightᵢ]. Interval i starts at position lᵢ ...
Problem 跟 3297. Count Substrings That Can Be Rearranged to Contain a String I 一模一样,只是多了一个注意点: Note that the memory limits in ...
Problem You are given an integer array nums. You can do the following operation on the array at most once: Choose any intege...
Problem 跟 3042. Count Prefix and Suffix Pairs I 一模一样,但单词数量从 50 提升到 10⁵,同时单词的长度也从 10 提升到 10⁵。 https://leetcode.com/problems/co...
Problem 唯一中间众数子序列。 Given an integer array nums, find the number of subsequences of size 5 of nums with a unique middle mode...
跟 3398. Smallest Substring With Identical Characters I 一模一样,只不过 s 的长度上限从 1000 增加到 10⁵。 https://leetcode.com/problems/smallest...
Problem You are given a binary string s of length n and an integer numOps. You are allowed to perform the following operation...
Problem You are given three integers n, m, k. A good array arr of size n is defined as follows: Each element in arr is in th...
Problem A k-booking happens when k events have some non-empty intersection (i.e., there is some time that is common to all k ...
Problem Given a string s, return the number of different non-empty palindromic subsequences in s. Since the answer may be ver...
Problem A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as fol...
Problem You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digit...
Problem You are given an array of unique strings words where words[i] is six letters long. One word of words was chosen as a ...
Problem You are given a list of strings of the same length words and a string target. Your task is to form target using the g...
Problem Design a Skiplist without using any built-in libraries. A skiplist is a data structure that takes O(log(n)) time to a...
Problem Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an int...
Problem You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where:...
Problem Given an integer array nums and an integer k, find three non-overlapping subarrays of length k with maximum sum and r...
Problem You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled fro...
跟 3218. Minimum Cost for Cutting Cake I 一模一样,只不过 m 和 n 的量级从 20 增加到 10⁵,因此只能用 O(n log n) 贪心解法。 https://leetcode.cn/problems/mi...
Problem There is an m x n cake that needs to be cut into 1 x 1 pieces. You are given integers m, n, and two arrays: horizont...
Problem You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge. Th...
Problem There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1. The edges in the graph...
Problem There exist two undirected trees with n and m nodes, numbered from 0 to n - 1 and from 0 to m - 1, respectively. You ...