Skip to content

symmetricorder

bradendubois edited this page Nov 24, 2021 · 10 revisions

Symmetric Order

ID: symmetricorder

Difficulty: 1.6

CPU Time: 1 second

Memory: 1024 MB

Solution

To create the symmetric shape, we want to take every second name and store them for later, and then output those in reverse order they were stored. For this, we can use a stack, and simply push every second name we read in, and output the other ones, and then pop every name off the stack, outputting as we go.

Clone this wiki locally