JZLeetCode
RSS FeedHigh quality leet code solutions in Java, Python, C++, and Rust.
Comment in the Disqus section at the bottom of every post (you may have to refresh) if you have any questions. You can also share the solution on social media with the buttons at the bottom left of each post.
Please add a note that your reference or source is @JZLeetCode.
Social links for BuyMeCoffee is below and at the bottom right of every post. Donations are greatly appreciated and welcomed.
Read the blog posts or check About for more info.
Featured
-
LeetCode 322 Coin Change
Solutions for LeetCode 322, medium, tags: array, dynamic programming, breadth-first search.
-
LeetCode 895 Maximum Frequency Stack
Solutions for LeetCode 895, hard, tags: hash table, stack, design, ordered set.
-
LeetCode 39 Combination Sum
Solutions for LeetCode 39, medium, tags: array, backtracking.
-
LeetCode 72 Edit Distance
Solutions for LeetCode 72, medium, tags: string, dynamic programming.
-
LeetCode 128 Longest Consecutive Sequence
Solutions for LeetCode 128, medium, tags: array, hash table, union find.
-
System Design - How Rate Limiting Works
How rate limiting works: token bucket, leaky bucket, fixed window counter, and sliding window log/counter algorithms with ASCII diagrams, source code walkthrough from Nginx, Guava, and Redis, and practical trade-offs.
-
LeetCode 2452 Words Within Two Edits of Dictionary
Solutions for LeetCode 2452, medium, tags: array, string, trie.
-
LeetCode 907 Sum of Subarray Minimums
Solutions for LeetCode 907, medium, tags: array, dynamic programming, stack, monotonic stack.
-
LeetCode 300 Longest Increasing Subsequence
Solutions for LeetCode 300, medium, tags: array, binary search, dynamic programming.
-
LeetCode 33 Search in Rotated Sorted Array
Solutions for LeetCode 33, medium, tags: array, binary search.
Recent Posts
-
LeetCode 2257 Count Unguarded Cells in the Grid
Updated:Solutions for LeetCode 2257, medium, tags: array, graph, simulation.
-
LeetCode 2461 Maximum Sum of Distinct Subarrays With Length K
Updated:Solutions for LeetCode 2461, medium, tags: array, sliding window, hash.
-
LeetCode 1574 Shortest Subarray to be Removed to Make Array Sorted
Updated:Solutions for LeetCode 1574, medium, tags: array, binary-search, two-pointers.
-
LeetCode 1652 Defuse the Bomb
Updated:Solutions for LeetCode 1652, easy, tags: array, sliding window.
-
System Design - How Linux epoll Works
How Linux epoll works: the evolution from select/poll, epoll's internal architecture with red-black trees and ready lists, level-triggered vs edge-triggered modes, and a source code walkthrough from the Linux kernel.
-
LeetCode 2064 Minimized Maximum of Products Distributed to Any Store
Updated:Solutions for LeetCode 2064, medium, tags: array, binary search, heap.
-
System Design - How Redis Persistence Works
How Redis persists data to disk: RDB snapshots via fork() and copy-on-write, AOF (Append Only File) logging, fsync policies, AOF rewriting, and the hybrid RDB+AOF approach. Source code walkthrough from the redis/redis repository.
-
System Design - How Linux Containers Work Under the Hood
How Linux containers work: namespaces for isolation, cgroups for resource limits, union filesystems for layered images, and how container runtimes like runc tie it all together.