Dec-26-2018, 10:54 PM
If the bit-strings have a bounded/"constant" length then it's just O(len(L)). Otherwise it's O(sum(map(len, L))) if you treat L as having real bit-strings instead of numbers.
By the way, you have a lot of indirection in your code. You create lists and append 1 to them to later add those 1s to a counter. You can skip putting 1s in the lists and just increment the counter directly. I would also in-line the str() call, no need for an extra list there.
By the way, you have a lot of indirection in your code. You create lists and append 1 to them to later add those 1s to a counter. You can skip putting 1s in the lists and just increment the counter directly. I would also in-line the str() call, no need for an extra list there.