全站内容
easy
3065. Minimum Operations to Exceed Threshold Value I
#Problem You are given a 0-indexed integer array nums, and an integer k. In one operation, you can remove one occurrence of the smallest element of nums. Return the minimum number of operations needed so that all elements of the array are …
3270. Find the Key of the Numbers
#Problem You are given three positive integers num1, num2, and num3. The key of num1, num2, and num3 is defined as a four-digit number such that: Initially, if any number has less than four digits, it is padded with leading zeros. The iᵗʰ …
2185. Counting Words With a Given Prefix
#Problem You are given an array of strings words and a string pref. Return the number of strings in words that contain pref as a prefix. A prefix of a string s is any leading contiguous substring of s. …
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 strings, str1 and str2: isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of str2, and …
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 is a substring of num with length 3. It consists of only one unique digit. Return the maximum good integer as a …
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 answer in any order. A substring is a contiguous sequence of characters within a string. …
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 used key. For example, s = "ab" has a change of a key while s = "bBBb" does not have any. Return the number of …
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://leetcode.com/problems/maximum-product-of-three-numbers/ Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: …
674. Longest Continuous Increasing Subsequence
#Problem Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be strictly increasing. A continuous increasing subsequence is defined by two …
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 and b == d), or (a == d and b == c) - that is, one domino can be rotated to be equal to another domino. Return the …