Skip to content

Commit 9c9d890

Browse files
authored
Update find-the-k-th-character-in-string-game-i.py
1 parent 01eba46 commit 9c9d890

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/find-the-k-th-character-in-string-game-i.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ def kthCharacter(self, k):
1111
def popcount(x):
1212
return bin(x)[2:].count('1')
1313

14-
return chr(ord('a')+popcount(k-1))
14+
return chr(ord('a')+popcount(k-1)%26)

0 commit comments

Comments
 (0)