I have two arrays of the same length. First array is static with data of such format
a = [['q', 10], ['s', 20], ['z', 40], ['d', 15]] and another array b = [1, 0, 0, 1]. So ['q', 10] in mind is related to 1, ['s', 20] - to 0, ['z', 40] to 0, ['d', 15] to 1.
Then I do some sorting of the first array and receive, for example, a = [['d', 15], ['s', 20], ['q', 10], ['z', 40]]. So in what way can I change second array to receive b = [1, 0, 1, 0]?
Important. It is not possible to add/change any data in first array.