Sometimes the constant factor is important when it's really performance-critical.
For example, heap sort and merge sort typically has a much bigger constant runtime factor than quick sort.
the simplification is valable/usefull for comparisons only if you compare different "degrees of complexity"
O(2n) == O(n)
O(2N) while it's easy to do it in O(N)...
Woops. Web scraping was hell on this one and I had a few problems with certain dogs, including the Shih Tzu. Everything should be fine now. I changed the example test case, and Shih Tzu is back in the dictionary!
Hey man! I've changed dogs to be a dict of sets. Makes more sense that way, although that didn't occur to me initially.
Nice solution by the way!
Seeing the same, for the Python 3 tests
This comment is hidden because it contains spoiler information about the solution
I passed the full tests just fine, but got an error with the sample tests because Shih Tzu doesn't seem to actually be in the dogs dictionary.
Thank you, good idea, I'll try to write one of these days.
In this context, it's perfect. It won't work with multiple missing values, however. Perhaps you could write another kata with multiple missing values?
The most important is that this method is the fastest and the least expensive.