mediumSimulationString 0 views
Process String with Special Operations I
You are given a string s consisting of lowercase English letters and the special characters: *, #, and %.
You are given a string s consisting of lowercase English letters and the special characters: *, #, and %.
Build a new string result by processing s according to the following rules from left to right:
Return the final string result after processing all characters in s.
Example 1
Input: s = "a#b%*"
Output: "ba"
Explanation: Thus, the final result is "ba" .
Example 2
Input: s = "z*#"
Output: ""
Explanation: Thus, the final result is "" .
Constraints
- 1 <= s.length <= 20
- s consists of only lowercase English letters and special characters *, #, and %.
Hints
Companies
No companies reported yet.
Discussion
Sign in to join the discussion.
Loading discussion...
Test results
No test cases yet.