State Street Interview Question

2 Pointers approach sorting and array