Relative Sort Array Leetcode Problems Python