Pregunta de entrevista de Better

Array based question(Sort an array in wave form).