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 2962 Count Subarrays Where Max Element Appears at Least K Times
Solutions for LeetCode 2962, medium, tags: array, sliding window, binary search.
-
LeetCode 338 Counting Bits
Solutions for LeetCode 338, easy, tags: dynamic programming, bit manipulation.
-
LeetCode 211 Design Add and Search Words Data Structure
Solutions for LeetCode 211, medium, tags: string, depth-first search, design, trie.
-
LeetCode 974 Subarray Sums Divisible by K
Solutions for LeetCode 974, medium, tags: array, hash table, prefix sum.
-
LeetCode 572 Subtree of Another Tree
Solutions for LeetCode 572, easy, tags: tree, dfs, string matching, binary tree, hash function.
-
LeetCode 904 Fruit Into Baskets
Solutions for LeetCode 904, medium, tags: array, hash table, sliding window.
-
LeetCode 224 Basic Calculator
Solutions for LeetCode 224, hard, tags: math, string, stack, recursion.
-
LeetCode 32 Longest Valid Parentheses
Solutions for LeetCode 32, hard, tags: string, stack, dynamic programming.
-
LeetCode 234 Palindrome Linked List
Solutions for LeetCode 234, easy, tags: linked list, two pointers, stack, recursion.
-
LeetCode 96 Unique Binary Search Trees
Solutions for LeetCode 96, medium, tags: math, dynamic programming, tree, binary search tree.
Recent Posts
-
System Design - How Distributed Stream Processing Works (Apache Flink)
How distributed stream processing works: dataflow graphs, event time vs processing time, windowing, watermarks, state management, checkpointing, and exactly-once semantics — with source code walkthrough from Apache Flink.
-
System Design - How Regex Engines Work
How regex engines work under the hood: Thompson's NFA construction, NFA-to-DFA conversion, backtracking, and how real implementations like RE2 and PCRE differ in their approach to matching.
-
System Design - How Compilers Turn Source Code into Machine Code
How compilers work: the full pipeline from source code to executable — lexing, parsing, AST construction, semantic analysis, intermediate representation, optimization passes, and code generation, with source code examples from real compilers.
-
AI/ML - How Neural Network Backpropagation Works
How backpropagation trains neural networks: the chain rule on computational graphs, forward pass, backward pass, gradient flow, vanishing gradients, and a source code walkthrough of PyTorch's autograd engine.
-
LeetCode 1679 Max Number of K-Sum Pairs
Solutions for LeetCode 1679, medium, tags: array, hash table, two pointers, sorting.
-
LeetCode 802 Find Eventual Safe States
Solutions for LeetCode 802, medium, tags: depth-first search, breadth-first search, graph, topological sort.
-
System Design - How the Linux Boot Process Works
How a Linux machine boots: from pressing the power button through firmware (BIOS/UEFI), bootloader (GRUB2), kernel decompression, the init process, and systemd — with source code walkthrough from the Linux kernel.
-
LeetCode 692 Top K Frequent Words
Solutions for LeetCode 692, medium, tags: hash table, string, trie, sorting, heap, bucket sort, counting.