Amazon Interview Question

regular algorithm questions