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 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.
-
LeetCode 2090 K Radius Subarray Averages
Solutions for LeetCode 2090, medium, tags: array, sliding window, prefix sum.
-
LeetCode 2592 Maximize Greatness of an Array
Solutions for LeetCode 2592, medium, tags: array, two pointers, greedy, sorting.
Recent Posts
-
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.
-
System Design - How TiKV Applies Committed Raft Entries in Source Code
Trace a committed TiKV Raft entry through the Peer, ApplyFsm, ApplyDelegate, and KV engine, including the apply index and worker settings.
-
System Design - How Java Virtual Threads Work
How Java virtual threads let blocking request code handle more concurrent I/O by parking on a small set of carrier threads, and where CPU work, pinning, and resource limits still matter.
-
TiDB Source Walkthrough - How PLAN REPLAYER DUMP EXPLAIN Works
Follow TiDB's PLAN REPLAYER DUMP EXPLAIN from PlanReplayerExec through the archive builder to the download handler, and see which schema, statistics, bindings, and settings help reproduce a plan.
-
AI/ML - How Mixture of Experts Models Work
A beginner-friendly tour of MoE routers, sparse expert activation, load balancing, and why more model capacity brings memory and communication costs.
-
System Design - How TiDB Handles Prepared Statements in the MySQL Binary Protocol
Follow COM_STMT_PREPARE, COM_STMT_EXECUTE, and COM_STMT_CLOSE through TiDB's connection, session, parameter decoder, and configuration.