Skip to content

tripletexting

bradendubois edited this page Oct 7, 2021 · 8 revisions

Triple Texting

ID: tripletexting

Difficulty: 1.6

CPU Time: 2 seconds

Memory: 1024 MB

Solution

For this, take in the string s and consider the it as broken into 3 sections of equal length. Iterate over these three sections in parallel, essentially; iterate over the first section, and if a position in the first section matches the same spot in the second section, output it, otherwise output that position in the third section.

Clone this wiki locally