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 1048 Longest String Chain
Solutions for LeetCode 1048, medium, tags: array, hash table, two pointers, string, dynamic programming.
-
LeetCode 452 Minimum Number of Arrows to Burst Balloons
Solutions for LeetCode 452, medium, tags: array, greedy, sorting.
-
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.
Recent Posts
-
System Design - How the Linux OOM Killer Works
How the Linux Out-of-Memory (OOM) Killer works: when it triggers, how it scores processes, the kill decision algorithm, cgroup-aware behavior, and a source code walkthrough from the Linux kernel.
-
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.
-
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.
-
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.