This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
916. Word Subsets | |
Medium | |
Companies | |
You are given two string arrays words1 and words2. | |
A string b is a subset of string a if every letter in b occurs in a including multiplicity. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
1475. Final Prices With a Special Discount in a Shop | |
https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop | |
Easy | |
You are given an integer array prices where prices[i] is the price of the ith item in a shop. | |
There is a special discount for items in the shop. If you buy the ith item, then you will receive a discount equivalent to prices[j] where j is the minimum index such that j > i and prices[j] <= prices[i]. Otherwise, you will not receive any discount at all. | |
Return an integer array answer where answer[i] is the final price you will pay for the ith item of the shop, considering the special discount. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
2182. Construct String With Repeat Limit | |
https://leetcode.com/problems/construct-string-with-repeat-limit | |
Medium | |
Hint | |
You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a row. You do not have to use all characters from s. | |
Return the lexicographically largest repeatLimitedString possible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
3264. Final Array State After K Multiplication Operations I | |
https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i | |
Easy | |
You are given an integer array nums, an integer k, and an integer multiplier. | |
You need to perform k operations on nums. In each operation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
1792. Maximum Average Pass Ratio | |
https://leetcode.com/problems/maximum-average-pass-ratio | |
Medium | |
There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passi, totali]. You know beforehand that in the ith class, there are totali total students, but only passi number of students will pass the exam. | |
You are also given an integer extraStudents. There are another extraStudents brilliant students that are guaranteed to pass the exam of any class they are assigned to. You want to assign each of the extraStudents students to a class in a way that maximizes the average pass ratio across all the classes. | |
The pass ratio of a class is equal to the number of students of the class that will pass the exam divided by the total number of students of the class. The average pass ratio is the sum of pass ratios of all the classes divided by the number of the classes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://leetcode.com/problems/find-longest-special-substring-that-occurs-thrice-i | |
2981. Find Longest Special Substring That Occurs Thrice I | |
Medium | |
You are given a string s that consists of lowercase English letters. | |
A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://leetcode.com/problems/special-array-ii | |
3152. Special Array II | |
Medium | |
An array is considered special if every pair of its adjacent elements contains two numbers with different parity. | |
You are given an array of integer nums and a 2D integer matrix queries, where for queries[i] = [fromi, toi] your task is to check that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
https://leetcode.com/problems/two-best-non-overlapping-events/ | |
2054. Two Best Non-Overlapping Events | |
Solved | |
Medium | |
Topics | |
Companies | |
Hint | |
You are given a 0-indexed 2D integer array of events where events[i] = [startTimei, endTimei, valuei]. The ith event starts at startTimei and ends at endTimei, and if you attend this event, you will receive a value of valuei. You can choose at most two non-overlapping events to attend such that the sum of their values is maximized. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
1760. Minimum Limit of Balls in a Bag | |
Medium | |
You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations. | |
You can perform the following operation at most maxOperations times: | |
Take any bag of balls and divide it into two new bags with a positive number of balls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
https://leetcode.com/problems/maximum-number-of-integers-to-choose-from-a-range-i/description/?envType=daily-question&envId=2024-12-06 | |
2554. Maximum Number of Integers to Choose From a Range I | |
Solved | |
Medium | |
Topics | |
Companies | |
Hint | |
You are given an integer array banned and two integers n and maxSum. You are choosing some number of integers following the below rules: |
NewerOlder