AKUNA CAPITAL interview question

Arrays with duplicate values coding question.