Can anyone suggest a good solution to remove duplicates from nested lists if wanting to evaluate duplicates based on first element of each nested list?
The main list looks like this:
L = [['14', '65', 76], ['2', '5', 6], ['7', '12', 33], ['14', '22', 46]]
If there is another list with the same element at first position [k][0]
that had already occurred, then I'd like to remove that list and get this result:
L = [['14', '65', 76], ['2', '5', 6], ['7', '12', 33]]
Can you suggest an algorithm to achieve this goal?