Amazon Interview Question

easy to normal level coding questions.