Techspert Interview Question

How did you solve the challenge?