Python Sort Array By Another Arraylist And Linkedlist