Back to problems

Increase Exclamation Marks and Replace Periods

Algorithm · Upstart · Easy

Problem: Exclamation Escalation and Period Swap You are given a string. Apply two transformations in order: Boost exclamation groups: For every maximal contiguous run of exclamation marks (!), add one more ! to that run. A single ! becomes !!; !! becomes !!!; and so on. Convert periods: Change every period (.) into a single exclamation mark (!). Characters that are not exclamation marks or periods are left untouched. Input Format A single line containing the string s. Output…

Checking your access…