IBM interview question

Hackerrank programming questions.