3 ms·
This approach is great if you are practicing writing algorithms on your own time. If I was writing software professionally, I would think "this sounds like 'g
by goto11 5y ago
This approach is great if you are practicing writing algorithms on your own time.
If I was writing software professionally, I would think "this sounds like 'group by' in SQL, wonder what the equivalent is in Python", and then I would google for the the most common/idiomatic approach.