Problem · String
Increase Exclamations and Convert Periods
Learn this problemProblem statement
Transform text in two steps:
- Add one additional exclamation mark to every existing consecutive run of
!characters. - Replace every period
.with one exclamation mark.
Function
transformPunctuation(text: String) → StringExamples
Example 1
text = "Hello. Nice to meet you!!"return = "Hello! Nice to meet you!!!"The period becomes !, and the existing run !! gains one more exclamation mark.
More Upstart problems
- Coordinate Bounding BoxOA · Seen Jul 2026
- Interleave Equal-Length Strings by ColumnOA · Seen Jul 2026
- Scale Ingredient QuantitiesOA · Seen Jul 2026
- Bounding Box from CoordinatesOA · Seen May 2026
- Filter by Threshold and Return Name with Max ScoreOA · Seen May 2026
- Filter Odds and Reverse EvensOA · Seen May 2026
- Find the Wrong Digit Index in a SumOA · Seen May 2026