EXL Service Interview Question

Coding question based on basic DSA and puzzles