Nokia interview question

The question was related to the array sorting