Practice Process String with Special Operations I
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Start with an empty result and read s from left to right. Append lowercase letters. For *, remove the last character if one exists. For #, append a copy of the current result to itself. For %, reverse the current result. Return the final result.
Source: Process String with Special Operations I on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
s = "a#b%*"
Output
"ba"
# Example 2
Input
s = "z*#"
Output
""
Constraints
1 <= s.length <= 20
s consists of only lowercase English letters and special characters *, #, and %.
Related LeetCode Problems
Practice more problems similar to Process String with Special Operations I.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.