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 40 Combination Sum II
Solutions for LeetCode 40, medium, tags: array, backtracking, sorting.
-
LeetCode 50 Pow(x, n)
Solutions for LeetCode 50, medium, tags: math, recursion.
-
LeetCode 213 House Robber II
Solutions for LeetCode 213, medium, tags: array, dynamic programming.
-
LeetCode 1046 Last Stone Weight
Solutions for LeetCode 1046, easy, tags: array, heap, simulation.
-
LeetCode 1838 Frequency of the Most Frequent Element
Solutions for LeetCode 1838, medium, tags: array, binary search, greedy, sliding window, sorting, prefix sum.
-
LeetCode 2251 Number of Flowers in Full Bloom
Solutions for LeetCode 2251, hard, tags: array, binary search, sorting, prefix sum, ordered set.
-
LeetCode 1268 Search Suggestions System
Solutions for LeetCode 1268, medium, tags: array, string, binary search, sorting, trie, heap (priority queue).
-
LeetCode 97 Interleaving String
Solutions for LeetCode 97, medium, tags: string, dynamic programming.
-
LeetCode 208 Implement Trie (Prefix Tree)
Solutions for LeetCode 208, medium, tags: hash table, string, design, trie, companies: pinterest.
-
LeetCode 179 Largest Number
Solutions for LeetCode 179, medium, tags: array, string, greedy, sorting.
Recent Posts
-
System Design - How the Python GIL (Global Interpreter Lock) Works
How CPython's Global Interpreter Lock works: the GIL data structure, eval loop integration, tick vs timeout-based switching, GIL release during I/O, impact on threading, and the road to removing it (PEP 703, free-threaded Python 3.13+).
-
System Design - How Database Buffer Pool Management Works
How database buffer pools work: page abstraction, InnoDB buffer pool architecture, LRU with midpoint insertion, dirty page flushing, adaptive checkpointing, and source code walkthrough from MySQL/InnoDB.
-
System Design - How CPU SIMD and Vector Instructions Work
How CPU SIMD (Single Instruction, Multiple Data) works: the evolution from MMX to AVX-512, register layouts, data-parallel execution, auto-vectorization, intrinsics, and real-world source code examples from databases and machine learning libraries.
-
System Design - How the Linux Virtual File System (VFS) Works
How the Linux Virtual File System works: the abstraction layer that lets Linux support ext4, XFS, tmpfs, procfs, and hundreds of other filesystems through a single unified interface. Covers inodes, dentries, superblocks, file operations, and a source code walkthrough.
-
System Design - How Serializable Snapshot Isolation (SSI) Works
How Serializable Snapshot Isolation (SSI) works: the theory behind detecting dangerous read-write conflicts in MVCC databases, how PostgreSQL implements it, and why it matters for correctness without sacrificing concurrency.
-
LeetCode 1011 Capacity To Ship Packages Within D Days
Solutions for LeetCode 1011, medium, tags: array, binary search, greedy.
-
LeetCode 85 Maximal Rectangle
Solutions for LeetCode 85, hard, tags: array, dynamic programming, stack, matrix, monotonic stack.
-
LeetCode 142 Linked List Cycle II
Solutions for LeetCode 142, medium, tags: hash table, linked list, two pointers.