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 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.
-
LeetCode 1358 Number of Substrings Containing All Three Characters
Solutions for LeetCode 1358, medium, tags: string, sliding window, counting.
-
LeetCode 1658 Minimum Operations to Reduce X to Zero
Solutions for LeetCode 1658, medium, tags: array, sliding window, prefix sum, hash table.
Recent Posts
-
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.
-
System Design - How TiDB ANALYZE TABLE Builds Statistics in Source
Updated:Trace TiDB ANALYZE TABLE from planner tasks through TiKV scans and TiDB statistics executors to persisted histograms, Top-N values, and optimizer estimates.
-
System Design - How Webhooks Deliver Events Reliably
Updated:Follow an order event from a producer to a webhook receiver, then learn how durable queues, signatures, acknowledgments, retries, deduplication, and replay make delivery dependable.
-
System Design - How HashiCorp Vault Issues Dynamic Database Credentials
Follow a database credential from workload authentication through Vault policies, a secrets engine, and a renewable lease to expiration and revocation.
-
System Design - How TiDB Implements SHOW WARNINGS
Trace a TiDB diagnostic from StatementContext through its warning handler into SHOW WARNINGS, including SQL mode, warning counts, and the ShowExec output path.