
Decode Ways in TypeScript: Give Zero Its Proper Job
Solve Decode Ways in TypeScript with one‑digit and two‑digit choices, careful zero handling, exact intermediate counts, and a two‑counter solution.
Articles
LeetCode is a useful prompt for practising algorithmic judgement, but a finished answer is not much use without the route to it. My walkthroughs concentrate on recognising the pattern, rejecting the tempting brute‑force approach, and explaining the solution in JavaScript or TypeScript.

Solve Decode Ways in TypeScript with one‑digit and two‑digit choices, careful zero handling, exact intermediate counts, and a two‑counter solution.

Solve Cheapest Flights Within K Stops in TypeScript, using separate cost arrays to enforce the stop limit and avoid misleading cheapest‑arrival shortcuts.

Solve Network Delay Time in TypeScript with Dijkstra's algorithm, a small min‑heap, stale‑entry checks, and a clear explanation of when distances become final.

Find the longest increasing subsequence in TypeScript, from quadratic dynamic programming to binary search, with duplicate handling and a clear tails invariant.

Build an LRU cache in TypeScript with a hash map and doubly linked list, then compare it with a simpler JavaScript Map implementation and O(1) operations.

Build a circular queue in TypeScript using a head index and size. Trace wraparound, distinguish full from empty, and test sequences against an array.

Solve Kth Smallest Element in a BST with in‑order traversal, showing why the tree's ordering removes the need for a separate sorting step in interviews.

Solve Number of Provinces with union‑find in TypeScript, comparing DFS, connected components, path compression, union by rank, and matrix scanning.

Solve the N‑Queens problem with TypeScript backtracking, including the decision tree, constraints, complexity, and test cases.

A clear walkthrough of LeetCode Jump Game using a greedy algorithm, including why the farthest‑reach approach works and where slower ideas get stuck.

Solve LeetCode 207 in TypeScript with Kahn's algorithm and DFS cycle detection, comparing graph states, queue behaviour, complexity, and edge‑case tests.

Solve Rotting Oranges with multi‑source BFS in TypeScript, treating each queue level as one minute and tracking fresh cells until spread completes.

Solve Kth Largest Element in an Array with Quickselect in TypeScript, comparing sorting, heaps, partitioning, random pivots, and trade‑offs under pressure.

How to solve LeetCode Find Peak Element with binary search, and why local comparisons are enough even when the array is not sorted in the usual way.

How to solve Search in Rotated Sorted Array with modified binary search, identifying the sorted half each step and narrowing safely in TypeScript.

The 'Merge Two Sorted Lists' problem on LeetCode involves combining two sorted linked lists into one. Here, I explore a clear solution with TypeScript examples.

Choose DFS, BFS, or an explicit stack in TypeScript by required ordering, shortest paths, exit events, and memory use, with complete traversal implementations.

Solve Daily Temperatures with a monotonic stack in TypeScript, storing indices to find the next warmer day without repeated scanning and common mistakes.