IBM interview question

A coding question based on arrays.