IBM Interview Question

the time limit per ques. in 1st round was tricky.