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 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.
-
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.
Recent Posts
-
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 79 Word Search
Solutions for LeetCode 79, medium, tags: array, string, backtracking, matrix.
-
LeetCode 5 Longest Palindromic Substring
Solutions for LeetCode 5, medium, tags: string, dynamic programming.
-
System Design - How Virtual Memory and Paging Works
How virtual memory and paging works in modern operating systems: address translation, page tables, TLB, page faults, multi-level page tables, and a walkthrough of Linux's implementation.
-
LeetCode 2462 Total Cost to Hire K Workers
Solutions for LeetCode 2462, medium, tags: array, two pointers, heap (priority queue), simulation.
-
System Design - How the CPU Cache Hierarchy Works
How modern CPU caches work: the memory hierarchy from registers to DRAM, cache lines, associativity, write policies, coherence protocols (MESI), and false sharing — with source code examples showing real performance impact.