Amazon Interview Question

basic ds algo all from geeksforgeeks