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 1291 Sequential Digits
Solutions for LeetCode 1291, medium, tags: array, breadth-first search, queue, string.
-
LeetCode 328 Odd Even Linked List
Solutions for LeetCode 328, medium, tags: linked list, two pointers.
-
LeetCode 136 Single Number
Solutions for LeetCode 136, easy, tags: array, bit manipulation, hash table.
-
LeetCode 117 Populating Next Right Pointers in Each Node II
Solutions for LeetCode 117, medium, tags: tree, breadth-first search, linked list, binary tree.
-
LeetCode 1306 Jump Game III
Solutions for LeetCode 1306, medium: breadth-first and iterative depth-first search on an implicit graph of array indices.
-
LeetCode 2405 Optimal Partition of String
Solutions for LeetCode 2405, medium, tags: hash table, string, greedy.
-
LeetCode 2367 Number of Arithmetic Triplets
Solutions for LeetCode 2367, easy, tags: array, hash table.
-
LeetCode 1653 Minimum Deletions to Make String Balanced
Solutions for LeetCode 1653, medium, tags: string, dynamic programming.
-
LeetCode 3042 Count Prefix and Suffix Pairs I
Count prefix and suffix pairs by checking each ordered index pair.
-
LeetCode 2369 Check if There is a Valid Partition For The Array
Solution for LeetCode 2369, medium, tags: array, dynamic programming.
Recent Posts
-
LeetCode 2090 K Radius Subarray Averages
Updated:Solutions for LeetCode 2090, medium, tags: array, sliding window, prefix sum.
-
System Design - How the Model Context Protocol Connects AI Apps to Tools
A beginner-friendly tour of MCP's host, client, and server roles, capability discovery, JSON-RPC messages, transports, and trust boundaries.
-
System Design - How TiDB Executes UPDATE in Source Code
Follow one UPDATE from TiDB's selection plan through UpdateExec, row validation, secondary-index maintenance, and transactional writes.
-
System Design - How AWS Lambda Reuses Execution Environments
Follow a Lambda request through initialization, invocation, freezing, and reuse, and learn which state can safely survive between calls.
-
System Design - How TiDB Executes AS OF TIMESTAMP Reads
Trace one historical SELECT through TiDB's stale-read processor, transaction provider, and TiKV's safe timestamp and MVCC reader.
-
System Design - How KVM Runs a Virtual Machine
How Linux KVM and QEMU work together to create a virtual machine: vCPU execution, guest memory, VM exits, virtual devices, and the settings that choose hardware acceleration.
-
System Design - How TiDB's DELETE Executor Removes Rows
Follow one single-table DELETE through TiDB's DeleteExec: how child rows become handles, how the table layer removes row and index keys, and why deprecated batch-delete settings change transaction boundaries.
-
System Design - How MQTT Routes Messages Through a Broker
Follow an IoT message from publisher to subscriber, then compare MQTT QoS, retained messages, and persistent sessions.