3297. Count Substrings That Can Be Rearranged to Contain a String I

Problem You are given two strings word1 and word2. A string x is called valid if x can be rearranged to have word2 as a prefi...

medium

3410. Maximize Subarray Sum After Removing All Occurrences of One Element

Problem You are given an integer array nums. You can do the following operation on the array at most once: Choose any intege...

hard

3045. Count Prefix and Suffix Pairs II

Problem 跟 3042. Count Prefix and Suffix Pairs I 一模一样,但单词数量从 50 提升到 10⁵,同时单词的长度也从 10 提升到 10⁵。 https://leetcode.com/problems/co...

hard

3042. Count Prefix and Suffix Pairs I

Problem You are given a 0-indexed string array words. Let’s define a boolean function isPrefixAndSuffix that takes two string...

easy

2264. Largest 3-Same-Digit Number in String

Problem You are given a string num representing a large integer. An integer is good if it meets the following conditions: It...

easy

1408. String Matching in an Array

Problem Given an array of string words, return all strings in words that is a substring of another word. You can return the a...

easy

3019. Number of Changing Keys

Problem You are given a 0-indexed string s typed by a user. Changing a key is defined as using a key different from the last ...

easy

1186. Maximum Subarray Sum with One Deletion

Problem Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one el...

medium

1769. Minimum Number of Operations to Move All Balls to Each Box

Problem You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the iᵗʰ box is empty, and...

medium

2274. Maximum Consecutive Floors Without Special Floors

Problem Alice manages a company and has rented some floors of a building as office space. Alice has decided some of these flo...

medium

2381. Shifting Letters II

Problem You are given a string s of lowercase English letters and a 2D integer array shifts where shifts[i] = [startᵢ, endᵢ, ...

medium

848. Shifting Letters

Problem You are given a string s of lowercase English letters and an integer array shifts of the same length. Call the shift(...

medium

2241. Design an ATM Machine

Problem There is an ATM machine that stores banknotes of 5 denominations: 20, 50, 100, 200, and 500 dollars. Initially the AT...

medium

3395. Subsequences with a Unique Middle Mode I

Problem 唯一中间众数子序列。 Given an integer array nums, find the number of subsequences of size 5 of nums with a unique middle mode...

hard

3399. Smallest Substring With Identical Characters II

跟 3398. Smallest Substring With Identical Characters I 一模一样,只不过 s 的长度上限从 1000 增加到 10⁵。 https://leetcode.com/problems/smallest...

hard

3398. Smallest Substring With Identical Characters I

Problem You are given a binary string s of length n and an integer numOps. You are allowed to perform the following operation...

hard

1930. Unique Length-3 Palindromic Subsequences

Problem Given a string s, return the number of unique palindromes of length three that are a subsequence of s. Note that even...

medium

3405. Count the Number of Arrays with K Matching Adjacent Elements

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...

hard

628. Maximum Product of Three Numbers

Problem Given an integer array nums, find three numbers whose product is maximum and return the maximum product. https://leet...

easy

674. Longest Continuous Increasing Subsequence

Problem Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. su...

easy

1128. Number of Equivalent Domino Pairs

Problem Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a == c an...

easy

1260. Shift 2D Grid

Problem Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Element ...

easy

1374. Generate a String With Characters That Have Odd Counts

Problem Given an integer n, return a string with n characters such that each character in such string occurs an odd number of...

easy

1437. Check If All 1's Are at Least Length K Places Away

Problem Given an binary array nums and an integer k, return true if all 1’s are at least k places away from each other, other...

easy

2270. Number of Ways to Split Array

Problem You are given a 0-indexed integer array nums of length n. nums contains a valid split at index i if the following are...

medium

292. Nim Game

Problem You are playing the following Nim Game with your friend: Initially, there is a heap of stones on the table. You and ...

easy

171. Excel Sheet Column Number

Problem Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding co...

easy

168. Excel Sheet Column Title

Problem Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example: A...

easy

816. Ambiguous Coordinates

Problem We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed all commas, ...

medium

436. Find Right Interval

Problem You are given an array of intervals, where intervals[i] = [startᵢ, endᵢ] and each startᵢ is unique. The right interva...

medium

732. My Calendar III

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 ...

hard

731. My Calendar II

Problem You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a t...

medium
12345612