I have two arrays:
[["106373", "106374", "106375", "106376"], ["106377", "106378", "220183", "220184"], ["220185", "220186", "220187", "220188"], ["220189", "220190", "106379"]]
[["106373", 15], ["106374", 16], ["106375", 17], ["106376", 18], ["106377", 19], ["106378", 20], ["106379", 77], ["220183", 38], ["220184", 39], ["220185", 40], ["220186", 41], ["220187", 42], ["220188", 43], ["220189", 44], ["220190", 76]]
What I need is return an array equal to the first but with the items replaced by the number in the second with the same value. Expected result:
[[15, 16, 17, 18], [19, 20, 38, 39], [40, 41, 42, 43], [44, 76, 77]]
I tried a lot of loops with methods like select and map but with no success.