Ezvor

3744. Find Kth Character in Expanded String

MediumString Preparing judge… LeetCode
String

Hints

Hint 1
Use the index of a character in the word to calculate how many times it is repeated in t.
Hint 2
Reduce k by that repetition count as you iterate through the characters.
Hint 3
Handle spaces as single characters (cost 1) and reset the index counter for each new word.