Medium Complexity / TS 4.7+

two_sum.ts

Solves LeetCode's Two Sum in the type system: each number is streamed off a tuple while a record of seen values acts as the hash map, looking up Target − current via tuple-length subtraction and accumulating every matching pair.

Edit the source on the left. As you type, the type checker re-evaluates and prints the fully-resolved value of each concrete type alias on the right.

two_sum.ts
TS 5.9
Compiler Output View
Booting TypeScript…