Peech (Israel) interview question

Some leetcode question - array sort index