Citadel Interview Question

DSA questions were asked - medium to hard LC