IBM Interview Question

assessment; coding challenge on hackerrank