Skip to content

Commit 01eba46

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/find-the-k-th-character-in-string-game-i.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
class Solution {
66
public:
77
char kthCharacter(int k) {
8-
return 'a' + __builtin_popcount(k - 1);
8+
return 'a' + __builtin_popcount(k - 1) % 26;
99
}
1010
};

0 commit comments

Comments
 (0)