Pregunta de entrevista de Amazon

Leetcode array manipulation very easy, then a sorting based leetcode one