Back to problems

addDrama

Algorithm · Upstart · Easy

You are given a string. Perform the following transformations: Replace every '.' character with '!'. After the replacement, the string must be such that every group of consecutive '!' characters ends at a '!'. A single '!' by itself is considered a valid group. Return the resulting string. Examples Example 1 Input: Hello.World. Output: Hello!World! Explanation: Both periods become exclamation marks. The trailing period becomes a trailing '!', which forms a valid…

Checking your access…