On 19/01/2021 04:45, Bischoop wrote:
I sat to it again and solved it.
Congratulations! > lil = tuple(set(s)) # list of characters in s > > li=[0,0,0,0,0,0] # list for counted repeats I see a minor problem here. What happens if s contains more than len(li) characters?
import timeit
Since you seem interested in performance: imagine that the input is a very long string. Let's call the length N. How often do you iterate over its characters? How often does Tim's solution? -- https://mail.python.org/mailman/listinfo/python-list