Quick Overview

Transform punctuation so every original run of exclamation marks gains one mark and every original period becomes exactly one exclamation mark. A single left-to-right pass preserves all other Unicode characters and avoids treating converted periods as existing runs.

Rewrite Sentence-Ending Punctuation

Company: Upstart

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Online Assessment

Overview: Transform punctuation so every original run of exclamation marks gains one mark and every original period becomes exactly one exclamation mark. A single left-to-right pass preserves all other Unicode characters and avoids treating converted periods as existing runs.

Read the full Upstart Software Engineer interview experience this question came from

Loading…