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 309 Best Time to Buy and Sell Stock with Cooldown
Solutions for LeetCode 309, medium, tags: array, dynamic programming.
-
LeetCode 103 Binary Tree Zigzag Level Order Traversal
Solutions for LeetCode 103, medium, tags: tree, breadth-first search, binary tree.
-
LeetCode 64 Minimum Path Sum
Solutions for LeetCode 64, medium, tags: array, dynamic programming, matrix.
-
LeetCode 120 Triangle
Solutions for LeetCode 120, medium, tags: array, dynamic programming.
-
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.
Recent Posts
-
System Design - How the ARIES Recovery Algorithm Works
How the ARIES recovery algorithm works: WAL, steal/no-force buffer management, LSN-based tracking, fuzzy checkpointing, and the three-pass recovery protocol (analysis, redo, undo) with source code references from PostgreSQL and InnoDB.
-
System Design - How Content Delivery Networks (CDNs) Work
How Content Delivery Networks (CDNs) work: architecture, DNS-based routing, anycast, edge caching, cache hierarchies, TLS termination, cache invalidation strategies, and source code walkthrough from Varnish Cache.
-
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.
-
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.