You are viewing a single comment's thread. Return to all comments →
Unfortunately, I think this is O(n^2). Not that it matters too much for a problem with 100 socks :)
The issue is that set(socks) is of size O(n) and list.count() method's runtime is O(n)
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →
Unfortunately, I think this is O(n^2). Not that it matters too much for a problem with 100 socks :)
The issue is that set(socks) is of size O(n) and list.count() method's runtime is O(n)