I have this array:
[{'id_1': 5}, {'id_2': 10}, {'id_2': 4}]
And I want the output as:
[
[5],
[10,4]
]
I tried looping and creating specific arrays to track the used indexes but I feel that there should be a more performant way that's O(n) instead of O(n2)