Publicis Sapient interview question

reverse the array coding round.