Amazon interview question

Don't remember, two algorithms problems leetcode style