GlobalLogic interview question

it was easy