Barclays interview question

Variation of Leetcode questions. Primarily arrays and sorting.