Amazon Interview Question

Don't remember, two algorithms problems leetcode style