Biweekly Contest 128 – 3/4
Q1: https://leetcode.com/problems/score-of-a-string/ Q2: https://leetcode.com/problems/minimum-rectangles-to-cover-points/ Notes: The y values don’t matter; only the x values matter. Q3: https://leetcode.com/problems/minimum-time-to-visit-disappearing-nodes/description/ Notes: Use Dijkstra’s...
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 – 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.