Given a list: [a b c d e f g h] and a command to set the order of the following in the list: [d a c g] Assign the items in the initial list a numeric index: [a b c d e f g h] [1 2 3 4 5 6 7 8] Build a new map with the input items and their existing numeric order: [ 1 => a 3 => c 4 => d 7 => g ] For each item in the input list in the given order, set the value in the map: [ 1 => d 3 => a 4 => c 7 => g ] For each item in the new map, change the value at the corresponding numeric index of the list: [d b a c e f g h] [1 2 3 4 5 6 7 8]
WeChat ID
aaronpk_tv