Daily Question – 2962. Count Subarrays Where Max Element Appears at Least K Times
Not a hard question, but I need to read the description more carefully.
Daily Question – 2958. Length of Longest Subarray With at Most K Frequency
Description: https://leetcode.com/problems/length-of-longest-subarray-with-at-most-k-frequency/description/ Notes: The first solution that came to my mind was brute force: scanning each...
Daily Question – 1669. Merge In Between Linked Lists
Description: https://leetcode.com/problems/merge-in-between-linked-lists/description/ Notes: Well, the solution for this one is quite straightforward. Defines a method mergeInBetween that replaces...
Daily Question – 452. Minimum Number of Arrows to Burst Balloons
My initial approach is to merge the intervals in the points array by calculating their overlapping parts. Each merged interval requires one arrow. Therefore, by counting the number of merged intervals, I can determine the minimum number of arrows needed to burst all balloons.
Daily Question – 930. Binary Subarrays With Sum
Description: https://leetcode.com/problems/binary-subarrays-with-sum/description/ Notes: My initial approach was a brute force method, which had a time complexity...
Daily Question – 30. Substring with Concatenation of All Words
My initial approach is quite straightforward: I use two hashmaps. The first hashmap is used to store the required words, and the second one is used to check whether the word counts in each substring are the same.
Daily Question – 1171. Remove Zero Sum Consecutive Nodes from Linked List
The initial attempt failed.
Daily Question – 791. Custom Sort String
I utilized a hashmap to count the number of characters in a specific order. This map stores the characters from the ‘order’ string as keys and their corresponding counts as values. The reason for choosing a LinkedHashMap is to preserve the order in which the characters were inserted.
Weekly Contest – 388
This is the first time I have joined the Leetcode contest, the problems are not as difficult as I thought before, and quite straightforward. Maybe is just the rookie luck, I guess. I finished 2 of 4 and finished the third problem later.
Daily Question – 25. Reverse Nodes in k-Group
Description: https://leetcode.com/problems/reverse-nodes-in-k-group/description/ Note: Code: