According to https://wiki.python.org/moin/TimeComplexity, x in s
operation take O(n)
in worst case.
Since set use hash internally, I think it should be O(1)
instead of O(n)
?
According to https://wiki.python.org/moin/TimeComplexity, x in s
operation take O(n)
in worst case.
Since set use hash internally, I think it should be O(1)
instead of O(n)
?