Code Signal_练习题_differentSymbolsNaive

时间:2021-03-01 08:02:27

Given a string, find the number of different characters in it.

Example

For s = "cabca", the output should be
differentSymbolsNaive(s) = 3.

There are 3 different characters ab and c.

我的解答:

def differentSymbolsNaive(s):
return len(set(s))
一模一样

膜拜大佬