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 1003 Check If Word Is Valid After Substitutions
Solutions for LeetCode 1003, medium, tags: string, stack.
-
LeetCode 1768 Merge Strings Alternately
Solution for LeetCode 1768, easy, tags: string, two pointers.
-
LeetCode 1700 Number of Students Unable to Eat Lunch
Solutions for LeetCode 1700, easy, tags: array, queue, simulation, counting.
-
LeetCode 1963 Minimum Number of Swaps to Make the String Balanced
An O(n)-time, O(1)-space solution to LeetCode 1963 using unmatched brackets.
-
LeetCode 2215 Find the Difference of Two Arrays
Solution for LeetCode 2215, easy, tags: array, hash table.
-
LeetCode 2000 Reverse Prefix of Word
Solution for LeetCode 2000, easy, tags: string, two pointers.
-
LeetCode 1034 Coloring A Border
Iterative BFS solution for LeetCode 1034, Coloring A Border.
-
LeetCode 2485 Find the Pivot Integer
Solutions for LeetCode 2485, easy, tags: math, prefix sum.
-
LeetCode 1047 Remove All Adjacent Duplicates In String
Solution for LeetCode 1047, easy, tags: string, stack, simulation.
-
LeetCode 1657 Determine if Two Strings Are Close
Solution for LeetCode 1657, medium, tags: hash table, string, sorting, counting.
Recent Posts
-
System Design - How Email Delivery Works: SMTP, DNS, SPF, DKIM, and DMARC
A practical guide to Internet email delivery: how SMTP servers discover recipients with DNS, how message transfer differs from mailbox access, and how SPF, DKIM, and DMARC reduce spoofing.
-
System Design - How TiDB INSERT VALUES Writes Rows in Source Code
A focused TiDB source walkthrough of INSERT ... VALUES: how InsertExec turns expressions into rows, batches optional large inserts, and delegates record and index writes to TableCommon.
-
System Design - How TiDB SET Updates Session State in Source Code
A focused TiDB source walkthrough of SET: how session.ExecuteStmt compiles a Set plan, how SetExecutor evaluates assignments, and how SessionVars validates and stores user, session, global, and instance variables.
-
System Design - How NTP Keeps Computer Clocks in Sync
How Network Time Protocol (NTP) estimates clock offset and network delay, selects trustworthy servers, disciplines a local clock, and copes with jitter, asymmetric paths, and failures.
-
System Design - How HTTP Caching Works
A practical mental model for HTTP caching: freshness, validation, Cache-Control, validators, and safe policies for versioned assets and dynamic responses.
-
System Design - How TiDB Statement Summary Works in Source Code
Follow one completed TiDB statement into the bounded digest map, interval history, and statement-summary tables, with the key source types and configuration controls.
-
System Design - How a Count-Min Sketch Estimates Frequencies
Follow a small stream through the counters of a count-min sketch, see why collisions only overestimate counts, and learn when its memory and error guarantees are useful.
-
System Design - How TiDB's EXPLAIN Executor Produces Plan Rows
Trace a SELECT's EXPLAIN and EXPLAIN ANALYZE through TiDB's planner, executor builder, and ExplainExec to see when SQL runs and how plan rows reach the client.