MAQ Software Interview Question

Basic DSA very basic and easy stuff