Amazon Interview Question

Mostly twisted version of leetcode medium and hard questions.