Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Seems like ordered set is not do able in python built in libraries?

Yung Chau

May 25, 2024

I think it should be detailed in python there exists no such pattern unless we create the class ourselves.

Because the python solution starts us off with defaultdict and not collections.OrderedDict which implies we need to sort regardless of which structure we use?

0

0

Comments
Comments
S
Sandip Bhattacharyaa year ago

Python's OrderedDict is about ordering items based on when they were inserted, and not by the value of some key.

So you are right that we will need to create our own implementation.

On this page