ABC Interview Question

Solve Hackerrank problem in 5 minutes