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 295 Find Median from Data Stream
Solutions for LeetCode 295, hard, tags: two pointers, design, sorting, heap, data stream.
-
LeetCode 139 Word Break
Solutions for LeetCode 139, medium, tags: dynamic programming, hash table, string, trie, memoization.
-
LeetCode 11 Container With Most Water
Solutions for LeetCode 11, medium, tags: array, two pointers, greedy.
-
LeetCode 84 Largest Rectangle in Histogram
Solutions for LeetCode 84, hard, tags: array, stack, monotonic stack.
-
LeetCode 22 Generate Parentheses
Solutions for LeetCode 22, medium, tags: string, dynamic programming, backtracking.
-
LeetCode 207 Course Schedule
Solutions for LeetCode 207, medium, tags: depth-first search, breadth-first search, graph, topological sort.
-
LeetCode 735 Asteroid Collision
Solutions for LeetCode 735, medium, tags: array, stack, simulation.
-
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.
Recent Posts
-
System Design - How TCP Congestion Control Works
How TCP congestion control works: slow start, congestion avoidance, fast retransmit, fast recovery, and modern algorithms like CUBIC and BBR — explained with ASCII diagrams and Linux kernel source references.
-
System Design - How Raft Consensus Algorithm Works
A deep dive into how Raft consensus algorithm achieves fault-tolerant replication in distributed systems — leader election, log replication, and safety guarantees explained with ASCII diagrams and source code references.
-
System Design - How Git Internals Work
How Git works under the hood: the four object types (blob, tree, commit, tag), content-addressable storage, refs and branches, the staging area (index), packfiles and delta compression, and merge strategies — with ASCII diagrams and source code walkthrough from the git/git repository.
-
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.