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 1249 Minimum Remove to Make Valid Parentheses
Solutions for LeetCode 1249, medium, tags: string, stack.
-
LeetCode 438 Find All Anagrams in a String
Solutions for LeetCode 438, medium, tags: hash table, string, sliding window.
-
LeetCode 153 Find Minimum in Rotated Sorted Array
Solutions for LeetCode 153, medium, tags: array, binary search.
-
LeetCode 787 Cheapest Flights Within K Stops
Solutions for LeetCode 787, medium, tags: dynamic programming, BFS, graph, heap, shortest path.
-
LeetCode 114 Flatten Binary Tree to Linked List
Solutions for LeetCode 114, medium, tags: tree, depth-first search, linked list, stack, binary tree.
-
LeetCode 236 Lowest Common Ancestor of a Binary Tree
Solutions for LeetCode 236, medium, tags: tree, dfs, binary tree.
-
LeetCode 1143 Longest Common Subsequence
Solutions for LeetCode 1143, medium, tags: string, dynamic programming.
-
LeetCode 312 Burst Balloons
Solutions for LeetCode 312, hard, tags: array, dynamic programming.
-
LeetCode 62 Unique Paths
Solutions for LeetCode 62, medium, tags: math, dynamic programming, combinatorics.
-
LeetCode 1091 Shortest Path in Binary Matrix
Solutions for LeetCode 1091, medium, tags: array, breadth-first search, matrix, shortest path.
Recent Posts
-
System Design - How Zero-Copy I/O Works
How zero-copy I/O works in Linux: the cost of traditional read/write, how sendfile() and splice() eliminate copies, how mmap fits in, and why Kafka and nginx are fast — with ASCII diagrams and kernel source code references.
-
System Design - How Go's Goroutine Scheduler Works
How Go's goroutine scheduler works: the GMP model (Goroutines, OS Threads, Processors), work stealing, preemption, netpoller integration, and a source code walkthrough from the Go runtime.
-
System Design - How Columnar Storage Works
How columnar storage works: row vs column layout, compression techniques, vectorized execution, Apache Parquet internals, and why modern analytics engines like ClickHouse and DuckDB are so fast.
-
LeetCode 138 Copy List with Random Pointer
Solutions for LeetCode 138, medium, tags: hash table, linked list.
-
System Design - How Raft Consensus Works
How the Raft consensus algorithm works: leader election, log replication, safety guarantees, membership changes, and source code walkthrough from the etcd/raft implementation.
-
LeetCode 239 Sliding Window Maximum
Solutions for LeetCode 239, hard, tags: array, queue, sliding window, heap, monotonic queue.
-
LeetCode 78 Subsets
Solutions for LeetCode 78, medium, tags: array, backtracking, bit manipulation.
-
LeetCode 647 Palindromic Substrings
Solutions for LeetCode 647, medium, tags: string, dynamic programming, two pointers.