Thursday, May 26, 2022

Leetcode algorithm practice: April 18 - May 16, 2022

 May 26, 2022

I solved another 35 algorithms from April 18 to May 16, 2022.
I got an email notification about Meta onsite cancellation. My onsite interview scheduled on May 16, 2022 was cancelled because of hiring freeze.
I will take 30 minutes to add those algorithms one by one in the following:

Container With Most Water
Find Median from Data Stream
Wiggle Sort II
Palindrome Linked List
Poor Pigs
Binary Watch
Number of Matching Subsequences
Game of Life
Find K Pairs with Smallest Sums
Number of Digit One
Verify Preorder Sequence in Binary Search Tree
Queue Reconstruction by Height
Flip String to Monotone Increasing
String Without AAA or BBB
Longest Common Prefix
Count Vowel Substrings of a String
Min Cost to Connect All Points
Number of Wonderful Substrings
The k Strongest Values in an Array
Sum of Subarray Minimums
Maximum Sum of Two Non-Overlapping Subarrays
Largest Multiple of Three
Maximum Distance Between a Pair of Values
Maximum Number of Consecutive Values You Can Make
Rank Transform of a Matrix

May 19, 2022
1632. Rank Transform of a Matrix
C# | Quick learner | Union find algorithm | Illustration using diagrams


1798. Maximum Number of Consecutive Values You Can Make
C# | Quick learner | I tried 10 minutes to figure out something first

May 17, 2022
1855. Maximum Distance Between a Pair of Values
C# | Two sorted arrays | Two pointer technique | Linear time complexity


1363. Largest Multiple of Three
C# | Quick learner | At most remove two digits


1031. Maximum Sum of Two Non-Overlapping Subarrays
C# | Quick learner | 30 minutes to study

May 12, 2022
907. Sum of Subarray Minimums
C# | Quick learner | Using stack O(N) time complexity | Play for fun


1471. The k Strongest Values in an Array
C# | Quick learner | two pointers

May 5, 2022
1915. Number of Wonderful Substrings
C# | Quick learner | 10 bits to represent a - j count as odd or even


1584. Min Cost to Connect All Points
C# | Quick learner | Union find algorithm

May 4, 2022
2062. Count Vowel Substrings of a String
C# | Quick learner | Sliding window

May 3, 2022
984. String Without AAA or BBB
C# | Quick learner | greedy idea


406. Queue Reconstruction by Height
C# | Quick learner from an example

May 2, 2022
255. Verify Preorder Sequence in Binary Search Tree
C# | 15 minutes as a quick learner | Recursive solution


233. Number of Digit One
C# | 30 minutes to work on hard level


373. Find K Pairs with Smallest Sums
C# | Minimum heap | SortedSet<Tuple<int, int, int> | Two neighbors: right and bottom


289. Game of Life
C# | in-place algorithm using module 10


792. Number of Matching Subsequences
C# | Group words by starting char | Avoid TLE error


401. Binary Watch
C# | Bit manipulation | DFS algorithm

April 26, 2022
458. Poor Pigs
C# | Hard level | One pig can test multiple buckets a time

April 25, 2022
234. Palindrome Linked List
C# | Optimal solution O(N) time complexity O(1) space
C# | Review of my practice in July 2018


324. Wiggle Sort II
C# | Using Sorting to find median value

April 22, 2022
295. Find Median from Data Stream
C# | Minimum heap and maximum heap | SortedSet<Tuple<int, int>>

April 19, 2022
11. Container With Most Water
C# | Two pointers technique | Time complexity: O(N)

No comments:

Post a Comment