
Solving the LeetCode 'Binary Tree Zigzag Level Order Traversal' Problem
Solve Binary Tree Zigzag Level Order Traversal with breadth‑first search, level sizing, alternating output order, and TypeScript implementation details.
Articles
LeetCode is a platform intended for preparing for technical coding interviews and improving coding skills. It presents hundreds of complex (and some less‑complex) problems, and invites users to submit solutions using the programming language of choice. Naturally, where I discuss solutions here, it will almost always be in a front‑end language like JavaScript or TypeScript...
Below you will find a subset of articles from my blog specifically about LeetCode. This is an area I have worked with for many years, and it has been a regular subject in my writing. There are fifty‑one articles collected together for you below.

Solve Binary Tree Zigzag Level Order Traversal with breadth‑first search, level sizing, alternating output order, and TypeScript implementation details.

Solve Binary Tree Level Order Traversal with breadth‑first search in TypeScript, using a queue, level sizing, edge cases, and cleaner iteration well.

Solve Subarray Sum Equals K with prefix sums and a hash map in TypeScript, including negative numbers, count storage, and why sliding window fails.

Solve Word Search with backtracking in JavaScript, covering recursive path exploration, visited state, pruning, restoration, and grid trade‑offs.

Solve Linked List Cycle with fast and slow pointers in TypeScript, comparing visited‑node storage with Floyd's cycle detection and common mistakes.

Solve Single Number in TypeScript with XOR bit manipulation, comparing hash maps, constant extra space, duplicate cancellation, and why the trick works.

How to solve Number of Islands with grid traversal, treating the matrix like a graph, marking visited land safely, and reasoning about DFS in TypeScript.

How to solve Longest Substring Without Repeating Characters with sliding window basics, comparing Set and last‑seen‑index approaches in TypeScript.

How to solve Trapping Rain Water with the two‑pointer approach, and the simple invariant that makes the O(n) solution click under interview pressure.

Unravel the art of finding the Longest Common Prefix in strings using TypeScript. Dive deep into Horizontal & Vertical Scanning methods with code insights.

Solve Merge Intervals in TypeScript by sorting ranges, merging overlaps, handling touching intervals, preserving inputs, and avoiding common mistakes.

How to solve Product of Array Except Self without division, using prefix and suffix products to keep the logic linear and interview‑safe in TypeScript.

nth Node from the End of a ListHow to remove the Nth node from the end of a linked list in TypeScript. Here we break down and explore a simple double‑pass and an efficient single‑pass method.

Distinguishing two approaches to detect palindrome numbers: the intuitive string method vs. the optimised mathematical technique, highlighting their merits.

Exploring the 'Find Median of Two Sorted Arrays' problem: Understand its significance in interviews, dive into a TypeScript solution, and test with Cypress.

Validate parentheses input in TypeScript with a stack, checking bracket order, matching pairs, real parser‑style use cases, and alternative approaches.

An exploration of solutions to the 'Letter Combinations of Phone Number' problem using front‑end and TypeScript: recursion, backtracking, and iteration.

Decode the mystique of Roman numerals! Discover their structure, learn their significance, and master the art of converting them back to integers in code.