#3304

Find the K-th Character in String Game I

newbie · 175 · lc easy +15 · 81.6% accepted · 646 likes · top 93%

Description

Alice and Bob play a game. Alice starts with word = "a". You are given positive integer k. Bob repeatedly asks Alice to:

- Increment each character in word by one (cyclically) to form a new string, then append it to word.

Return the k-th character of word once it has at least k characters.

Code

1
2
3