You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| 207 |[Course Schedule](//leetcode.com/problems/course-schedule)|[Go](problems/0207.go)| Medium |
98
+
| 208 |[Implement Trie (Prefix Tree)](//leetcode.com/problems/implement-trie-prefix-tree)|[Go](problems/0208.go)| Medium |
98
99
| 210 |[Course Schedule II](//leetcode.com/problems/course-schedule-ii)|[Go](problems/0210.go)| Medium |
99
100
| 213 |[House Robber II](//leetcode.com/problems/house-robber-ii)|[Go](problems/0213.go)| Medium |
100
101
| 215 |[Kth Largest Element in an Array](//leetcode.com/problems/kth-largest-element-in-an-array)|[C++](problems/0215.cpp)[Go](problems/0215.go)| Medium |
@@ -201,6 +202,7 @@ LeetCode Problems' Solutions
201
202
| 1347 |[Minimum Number of Steps to Make Two Strings Anagram](//leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram)|[Go](problems/1347.go)| Medium |
202
203
| 1354 |[Construct Target Array With Multiple Sums](//leetcode.com/problems/construct-target-array-with-multiple-sums)|[Go](problems/1354.go)| Hard |
203
204
| 1356 |[Sort Integers by The Number of 1 Bits](//leetcode.com/problems/sort-integers-by-the-number-of-1-bits)|[Go](problems/1356.go)| Easy |
205
+
| 1405 |[Longest Happy String](//leetcode.com/problems/longest-happy-string)|[Go](problems/1405.go)| Medium |
204
206
| 1423 |[Maximum Points You Can Obtain from Cards](//leetcode.com/problems/maximum-points-you-can-obtain-from-cards)|[Go](problems/1423.go)| Medium |
205
207
| 1438 |[Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit](//leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit)|[Go](problems/1438.go)| Medium |
206
208
| 1460 |[Make Two Arrays Equal by Reversing Subarrays](//leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays)|[Go](problems/1460.go)| Easy |
@@ -216,6 +218,7 @@ LeetCode Problems' Solutions
216
218
| 1567 |[Maximum Length of Subarray With Positive Product](//leetcode.com/problems/maximum-length-of-subarray-with-positive-product)|[Go](problems/1567.go)| Medium |
| 1588 |[Sum of All Odd Length Subarrays](//leetcode.com/problems/sum-of-all-odd-length-subarrays)|[Go](problems/1588.go)| Easy |
221
+
| 1593 |[// Split a String Into the Max Number of Unique Substrings](//leetcode.com/problems/split-a-string-into-the-max-number-of-unique-substrings)|[Go](problems/1593.go)| Medium |
| 1642 |[Furthest Building You Can Reach](//leetcode.com/problems/furthest-building-you-can-reach)|[Go](problems/1642.go)| Medium |
221
224
| 1647 |[Minimum Deletions to Make Character Frequencies Unique](//leetcode.com/problems/minimum-deletions-to-make-character-frequencies-unique)|[Go](problems/1647.go)| Medium |
@@ -229,6 +232,7 @@ LeetCode Problems' Solutions
229
232
| 1696 |[Jump Game VI](//leetcode.com/problems/jump-game-vi)|[Go](problems/1696.go)| Medium |
230
233
| 1704 |[Determine if String Halves Are Alike](//leetcode.com/problems/determine-if-string-halves-are-alike)|[Go](problems/1704.go)| Easy |
231
234
| 1710 |[Maximum Units on a Truck](//leetcode.com/problems/maximum-units-on-a-truck)|[Go](problems/1710.go)| Easy |
235
+
| 1760 |[Minimum Limit of Balls in a Bag](//leetcode.com/problems/minimum-limit-of-balls-in-a-bag)|[Go](problems/1760.go)| Medium |
| 1779 |[Find Nearest Point That Has the Same X or Y Coordinate](//leetcode.com/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate)|[Go](problems/1779.go)| Easy |
234
238
| 1790 |[Check if One String Swap Can Make Strings Equal](//leetcode.com/problems/check-if-one-string-swap-can-make-strings-equal)|[Go](problems/1790.go)| Easy |
@@ -237,6 +241,7 @@ LeetCode Problems' Solutions
237
241
| 1915 |[Number of Wonderful Substrings](//leetcode.com/problems/number-of-wonderful-substrings)|[Go](problems/1915.go)| Medium |
238
242
| 2000 |[Reverse Prefix of Word](//leetcode.com/problems/reverse-prefix-of-word)|[Go](problems/2000.go)| Easy |
239
243
| 2037 |[Minimum Number of Moves to Seat Everyone](//leetcode.com/problems/minimum-number-of-moves-to-seat-everyone)|[Go](problems/2037.go)| Easy |
244
+
| 2054 |[Two Best Non-Overlapping Events](//leetcode.com/problems/two-best-non-overlapping-events)|[Go](problems/2054.go)| Medium |
240
245
| 2125 |[Number of Laser Beams in a Bank](//leetcode.com/problems/number-of-laser-beams-in-a-bank)|[Go](problems/2125.go)| Medium |
241
246
| 2134 |[Minimum Swaps to Group All 1's Together II](//leetcode.com/problems/minimum-swaps-to-group-all-1s-together-ii)|[Go](problems/2134.go)| Medium |
242
247
| 2181 |[Merge Nodes in Between Zeros](//leetcode.com/problems/merge-nodes-in-between-zeros)|[Go](problems/2181.go)| Medium |
| 2337 |[Move Pieces to Obtain a String](//leetcode.com/problems/move-pieces-to-obtain-a-string)|[Go](problems/2337.go)| Medium |
249
255
| 2441 |[Largest Positive Integer That Exists With Its Negative](//leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative)|[Go](problems/2441.go)| Easy |
250
256
| 2487 |[Remove Nodes From Linked List](//leetcode.com/problems/remove-nodes-from-linked-list)|[Go](problems/2487.go)| Medium |
251
-
|2597|[The Number of Beautiful Subsets](//leetcode.com/problems/the-number-of-beautiful-subsets)|[Go](problems/2597.go)| Medium |
257
+
|2554|[Maximum Number of Integers to Choose From a Range I](//leetcode.com/problems/maximum-number-of-integers-to-choose-from-a-range-i)|[Go](problems/2554.go)| Medium |
252
258
| 2816 |[Double a Number Represented as a Linked List](//leetcode.com/problems/double-a-number-represented-as-a-linked-list)|[Go](problems/2816.go)| Medium |
253
259
| 2870 |[Minimum Number of Operations to Make Array Empty](//leetcode.com/problems/minimum-number-of-operations-to-make-array-empty)|[Go](problems/2870.go)| Medium |
260
+
| 2938 |[Separate Black and White Balls](//leetcode.com/problems/separate-black-and-white-balls)|[Go](problems/2938.go)| Medium |
261
+
| 2981 |[Find Longest Special Substring That Occurs Thrice I](//leetcode.com/problems/find-longest-special-substring-that-occurs-thrice-i)|[Go](problems/2981.go)| Medium |
254
262
| 2997 |[Minimum Number of Operations to Make Array XOR Equal to K](//leetcode.com/problems/minimum-number-of-operations-to-make-array-xor-equal-to-k)|[Go](problems/2997.go)| Medium |
255
263
| 3016 |[Minimum Number of Pushes to Type Word II](//leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii)|[Go](problems/3016.go)| Medium |
256
264
| 3075 |[Maximize Happiness of Selected Children](//leetcode.com/problems/maximize-happiness-of-selected-children)|[Go](problems/3075.go)| Medium |
265
+
| 3152 |[Special Array II](//leetcode.com/problems/special-array-ii)|[Go](problems/3152.go)| Medium |
// A **trie** (https://en.wikipedia.org/wiki/Trie) (pronounced as "try") or **prefix tree** is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.
8
+
//
9
+
// Implement the Trie class:
10
+
//
11
+
// - `Trie()` Initializes the trie object.
12
+
// - `void insert(String word)` Inserts the string `word` into the trie.
13
+
// - `boolean search(String word)` Returns `true` if the string `word` is in the trie (i.e., was inserted before), and `false` otherwise.
14
+
// - `boolean startsWith(String prefix)` Returns `true` if there is a previously inserted string `word` that has the prefix `prefix`, and `false` otherwise.
// A string s is called happy if it satisfies the following conditions:
8
+
//
9
+
// * s only contains the letters 'a', 'b', and 'c'.
10
+
// * s does not contain any of "aaa", "bbb", or "ccc" as a substring.
11
+
// * s contains at most a occurrences of the letter 'a'.
12
+
// * s contains at most b occurrences of the letter 'b'.
13
+
// * s contains at most c occurrences of the letter 'c'.
14
+
//
15
+
// Given three integers a, b, and c, return the longest possible happy string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string "".
16
+
//
17
+
// A substring is a contiguous sequence of characters within a string.
18
+
//
19
+
// Example 1:
20
+
//
21
+
// Input: a = 1, b = 1, c = 7
22
+
// Output: "ccaccbcc"
23
+
// Explanation: "ccbccacc" would also be a correct answer.
24
+
//
25
+
// Example 2:
26
+
//
27
+
// Input: a = 7, b = 1, c = 0
28
+
// Output: "aabaa"
29
+
// Explanation: It is the only correct answer in this case.
// Given a string s, return the maximum number of unique substrings that the given string can be split into.
8
+
// You can split string s into any list of non-empty substrings, where the concatenation of the substrings forms the original string. However, you must split the substrings such that all of them are unique.
9
+
// A substring is a contiguous sequence of characters within a string.
10
+
//
11
+
// Example 1:
12
+
//
13
+
// Input: s = "ababccc"
14
+
// Output: 5
15
+
// Explanation: One way to split maximally is ['a', 'b', 'ab', 'c', 'cc']. Splitting like ['a', 'b', 'a', 'b', 'c', 'cc'] is not valid as you have 'a' and 'b' multiple times.
16
+
//
17
+
// Example 2:
18
+
//
19
+
// Input: s = "aba"
20
+
// Output: 2
21
+
// Explanation: One way to split maximally is ['a', 'ba'].
22
+
//
23
+
// Example 3:
24
+
//
25
+
// Input: s = "aa"
26
+
// Output: 1
27
+
// Explanation: It is impossible to split the string any further.
0 commit comments