What is the fastest way to find the key or value with the longest name in a dictionary?

Viewed 26

Suppose, I have a dictionary Dict[str, str] containing 10000 items.

I want to find the key (or value) with the longest string length.

What is the fastest way to find that?

Is a for loop good enough?

0 Answers
Related