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 332 Reconstruct Itinerary
Solutions for LeetCode 332, hard, tags: graph, depth-first search, Eulerian path.
-
LeetCode 934 Shortest Bridge
Solutions for LeetCode 934, medium, tags: array, depth-first search, breadth-first search, matrix.
-
LeetCode 90 Subsets II
Solutions for LeetCode 90, medium, tags: array, backtracking, bit manipulation.
-
LeetCode 279 Perfect Squares
Solutions for LeetCode 279, medium, tags: dynamic programming, math.
-
LeetCode 410 Split Array Largest Sum
Solutions for LeetCode 410, hard, tags: array, binary search, dynamic programming, greedy, prefix sum.
-
LeetCode 1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Solutions for LeetCode 1438, medium, tags: array, queue, sliding window, ordered set, monotonic queue.
-
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.
Recent Posts
-
System Design - How etcd Works
How etcd works: Raft consensus, bbolt storage engine, MVCC revisions, watch mechanism, lease system, linearizable reads, and how Kubernetes depends on it.
-
System Design - How Load Balancers Work
How load balancers work: L4 vs L7, algorithms (round-robin, least-connections, consistent hashing), health checks, connection draining, and source code walkthrough from HAProxy and Nginx.
-
System Design - How Kubernetes Pod Scheduling Works
How Kubernetes pod scheduling works: the scheduling queue, filtering (predicates), scoring (priorities), binding, preemption, and a source code walkthrough from the kubernetes/kubernetes repository.
-
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.
-
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.
-
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.