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 2530 Maximal Score After Applying K Operations
Solution for LeetCode 2530, medium, tags: array, greedy, heap (priority queue).
-
LeetCode 1129 Shortest Path with Alternating Colors
Solutions for LeetCode 1129, medium, tags: graph, breadth-first search.
-
LeetCode 2602 Minimum Operations to Make All Array Elements Equal
Solutions for LeetCode 2602, medium, tags: array, binary search, sorting, prefix sum.
-
LeetCode 2730 Find the Longest Semi-Repetitive Substring
Solutions for LeetCode 2730, medium, tags: string, sliding window, two pointers.
-
LeetCode 3066 Minimum Operations to Exceed Threshold Value II
A min-heap simulation that repeatedly combines the two smallest values, with overflow-safe implementations in four languages.
-
LeetCode 945 Minimum Increment to Make Array Unique
Solutions for LeetCode 945, medium, tags: array, greedy, sorting, counting.
-
LeetCode 1094 Car Pooling
Solutions for LeetCode 1094, medium, tags: array, sorting, heap, simulation, prefix sum.
-
LeetCode 289 Game of Life
Solutions for LeetCode 289, medium, tags: array, matrix, simulation.
-
LeetCode 983 Minimum Cost For Tickets
Solutions for LeetCode 983, medium, tags: dynamic programming.
-
LeetCode 189 Rotate Array
Solutions for LeetCode 189, medium, tags: array, math, two pointers.
Recent Posts
-
System Design - How TiDB TTL Workers Delete Expired Rows
Follow an expired row through five TiDB TTL worker types: key-range scanning, the delete-task channel, guarded DELETE transactions, retry handling, and the settings that control their impact on TiKV.
-
System Design - How the Transactional Outbox Works
Why saving a database row and publishing an event can fail, and how a transactional outbox connects PostgreSQL, Debezium, Kafka, and an idempotent consumer without pretending delivery happens exactly once.
-
System Design - How Kubernetes Deployment Rolling Updates Work
A beginner-friendly walkthrough of how a Kubernetes Deployment replaces Pods gradually, using ReplicaSets, readiness, maxSurge, and maxUnavailable.
-
System Design - How TiDB Auto Analyze Works
A source-code walkthrough of TiDB auto analyze, from the stats-owner scheduler and priority queue to TiDB's Analyze executor and TiKV coprocessor.
-
System Design - How TiDB Point Get Works
Trace a TiDB Point_Get query from planner eligibility through PointGetExecutor to TiKV's snapshot Get, with source links, diagnostics, and relevant controls.
-
System Design - How WebAuthn Passkeys Work
A beginner-friendly walkthrough of passkey registration and sign-in, including WebAuthn challenges, public-key signatures, phishing resistance, and device sync.
-
System Design - How Apache Iceberg Works
A beginner-friendly walkthrough of Apache Iceberg's catalog, metadata, snapshots, manifests, file pruning, commits, and the trade-offs of building reliable tables on object storage.
-
System Design - How TiDB Index Lookup Pushdown Works
A source-code walkthrough of TiDB's double-read IndexLookUp plan, how TiDB and TiKV cooperate to push local row lookups down, and the policy, hint, and affinity settings that control it.