Amazon Interview Question

2 coding questions were asked