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 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.
-
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.
Recent Posts
-
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 142 Linked List Cycle II
Solutions for LeetCode 142, medium, tags: hash table, linked list, two pointers.
-
System Design - How the Linux I/O Scheduler Works
How the Linux I/O scheduler works: the block layer, request merging and sorting, multi-queue architecture, mq-deadline, BFQ, kyber, and how schedulers interact with storage devices.
-
LeetCode 740 Delete and Earn
Solutions for LeetCode 740, medium, tags: array, hash table, dynamic programming.
-
System Design - How Hash Tables Work Internally
How hash tables work under the hood: hash functions, collision resolution (chaining vs open addressing), load factors, resizing strategies, Robin Hood hashing, and a source code walkthrough of Go's built-in map.