Relative Sort Array Leetcode Solution 9