Skip to content

Practice Find the K-th Character in String Game II

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#3307
LeetCode Problem

Find the K-th Character in String Game II

Problem Statement

Start with word = "a" and process operations in order. An operation of 0 appends a copy of the current word. An operation of 1 appends a copy with each letter advanced by one, wrapping z to a. After all operations, return the kth character using 1-based indexing.

Source: Find the K-th Character in String Game II on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
k = 5, operations = [0,0,0]
Output
"a"

# Example 2

Input
k = 10, operations = [0,1,0,1]
Output
"b"

Constraints

1 <= k <= 10^14
1 <= operations.length <= 100
operations[i] is either 0 or 1.
The input is generated such that word has at least k characters after all operations.

Related LeetCode Problems

Practice more problems similar to Find the K-th Character in String Game II.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.