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 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.
-
LeetCode 1208 Get Equal Substrings Within Budget
Solutions for LeetCode 1208, medium, tags: string, sliding window.
Recent Posts
-
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.
-
System Design - How Erasure Coding Protects Stored Data
Learn how storage systems combine data and parity fragments to recover lost data, and why the space savings come with repair and placement trade-offs.
-
System Design - How TiDB TableDual Produces Rows Without a Table
Trace TiDB's TableDual from a logical plan to an executor, including zero-column rows, empty results, and chunk settings.