REX Interview Question

Mostly leetcode Medium