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 124 Binary Tree Maximum Path Sum
Solutions for LeetCode 124, hard, tags: tree, depth-first search, dynamic programming, binary tree.
-
LeetCode 973 K Closest Points to Origin
Solutions for LeetCode 973, medium, tags: array, math, divide and conquer, geometry, sorting, heap, quickselect.
-
LeetCode 162 Find Peak Element
Solutions for LeetCode 162, medium, tags: array, binary search.
-
LeetCode 981 Time Based Key-Value Store
Solutions for LeetCode 981, medium, tags: hash table, string, binary search, design.
-
LeetCode 287 Find the Duplicate Number
Solutions for LeetCode 287, medium, tags: array, two pointers, binary search, bit manipulation.
-
LeetCode 743 Network Delay Time
Solutions for LeetCode 743, medium, tags: graph, heap, shortest path, Dijkstra, Bellman-Ford.
-
LeetCode 134 Gas Station
Solutions for LeetCode 134, medium, tags: array, greedy.
-
LeetCode 763 Partition Labels
Solutions for LeetCode 763, medium, tags: hash table, two pointers, string, greedy.
-
LeetCode 74 Search a 2D Matrix
Solutions for LeetCode 74, medium, tags: array, binary search, matrix.
-
LeetCode 853 Car Fleet
Solutions for LeetCode 853, medium, tags: array, sorting, monotonic stack.
Recent Posts
-
System Design - How the Raft Consensus Algorithm Works
How the Raft consensus algorithm works: leader election, log replication, safety guarantees, membership changes, and source code walkthrough from the etcd/raft implementation.
-
System Design - How MapReduce Works
How Google's MapReduce programming model works: the map and reduce phases, data shuffling, fault tolerance, locality optimization, and a walkthrough of the execution model with real code examples.
-
System Design - How Database Replication Works
How database replication works: physical vs logical replication, MySQL binlog and PostgreSQL WAL streaming, replication lag, semi-synchronous commit, and the CAP trade-offs in real systems.
-
System Design - How Distributed Tracing Works
How distributed tracing works: trace/span model, context propagation, sampling strategies, and how systems like Jaeger, Zipkin, and OpenTelemetry implement end-to-end request tracking across microservices.
-
System Design - How CRDTs (Conflict-free Replicated Data Types) Work
How CRDTs enable conflict-free replication in distributed systems: state-based vs operation-based approaches, G-Counter, PN-Counter, LWW-Register, OR-Set, and real-world usage in collaborative editing, databases, and caches.
-
LeetCode 435 Non-overlapping Intervals
Solutions for LeetCode 435, medium, tags: array, dynamic programming, greedy, sorting.
-
LeetCode 621 Task Scheduler
Solutions for LeetCode 621, medium, tags: array, hash table, greedy, sorting, heap, counting.
-
LeetCode 79 Word Search
Solutions for LeetCode 79, medium, tags: array, string, backtracking, matrix.