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 19 Remove Nth Node From End of List
Solutions for LeetCode 19, medium, tags: linked list, two pointers.
-
LeetCode 131 Palindrome Partitioning
Solutions for LeetCode 131, medium, tags: string, dynamic programming, backtracking.
-
LeetCode 1514 Path with Maximum Probability
Solutions for LeetCode 1514, medium, tags: graph, heap, shortest path, bellman-ford.
-
LeetCode 739 Daily Temperatures
Solutions for LeetCode 739, medium, tags: array, stack, monotonic stack.
-
LeetCode 316 Remove Duplicate Letters
Solutions for LeetCode 316, medium, tags: string, stack, monotonic stack, greedy.
-
LeetCode 778 Swim in Rising Water
Solutions for LeetCode 778, hard, tags: array, binary search, depth-first search, breadth-first search, union find, heap (priority queue), matrix.
-
LeetCode 678 Valid Parenthesis String
Solutions for LeetCode 678, medium, tags: string, greedy, stack, dynamic programming.
-
LeetCode 337 House Robber III
Solutions for LeetCode 337, medium, tags: tree, dfs, dynamic programming, binary tree.
-
LeetCode 41 First Missing Positive
Solutions for LeetCode 41, hard, tags: array, hash table.
-
LeetCode 767 Reorganize String
Solutions for LeetCode 767, medium, tags: hash table, string, greedy, sorting, heap, counting.
Recent Posts
-
System Design - How Lamport Clocks and Vector Clocks Work
How logical clocks solve the ordering problem in distributed systems: Lamport clocks, vector clocks, causal ordering, happens-before relation, and real-world usage in databases like DynamoDB, Riak, and CockroachDB.
-
System Design - How WebAssembly (Wasm) Works
How WebAssembly works: binary format, stack-based virtual machine, module structure, linear memory model, compilation from source languages, and the security sandbox.
-
System Design - How the QUIC Protocol Works
How QUIC works: connection establishment, 0-RTT handshake, stream multiplexing without head-of-line blocking, loss detection, congestion control, and connection migration. A walkthrough of the protocol that powers HTTP/3.
-
System Design - How Linux System Calls Work
How Linux system calls work: the x86-64 syscall instruction, kernel entry/exit, the syscall dispatch table, vDSO optimization, and a source code walkthrough from the Linux kernel.
-
LeetCode 1584 Min Cost to Connect All Points
Solutions for LeetCode 1584, medium, tags: array, union find, graph, minimum spanning tree.
-
LeetCode 148 Sort List
Solutions for LeetCode 148, medium, tags: linked list, two pointers, divide and conquer, sorting, merge sort.
-
System Design - How Rust's Borrow Checker Works
How Rust's borrow checker enforces memory safety without garbage collection: ownership rules, borrowing, lifetimes, the NLL (Non-Lexical Lifetimes) algorithm, and a source code walkthrough from the rust-lang/rust compiler.
-
System Design - How Memory-Mapped Files (mmap) Work
How memory-mapped files (mmap) work: virtual memory mapping, page faults, kernel page cache interaction, copy-on-write semantics, and why databases love and hate them.