'list merging between list with condition in python [closed]

i have an output in a single list like this:

[[1, 74], [1, 224], [1, 247], [1, 5], [1, 225], [1, 207], [1, 79], [1, 131], [1, 180], [1, 20], [1, 104], [1, 93], [1, 213], [1, 93], [1, 151], [1, 223]]

[[2, 200], [2, 64], [2, 51], [2, 83], [2, 127], [2, 160], [2, 237], [2, 98], [2, 123], [2, 213], [2, 80], [2, 131], [2, 200], [2, 203], [2, 8], [2, 174]]

[[3, 148], [3, 72], [3, 37], [3, 40], [3, 237], [3, 24], [3, 177], [3, 205], [3, 52], [3, 53], [3, 155], [3, 208], [3, 184], [3, 44], [3, 202], [3, 171]]

but i want to make the output become:

[[1,74],[2,200],[3,148]]

[[1,224],[2,64],[3,72]]

[[1,247],[2,51],[3,37]]

and so on...

is it by mapping? or just looping then append? please help me with code



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source