Skip to content

simplicity

bradendubois edited this page Oct 7, 2021 · 8 revisions

Simplicity

ID: simplicity

Difficulty: 2.9

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, build a histogram of all the unique characters in the string; if there are only 1 or 2, output 0 and quit; otherwise, sort all the occurrences in ascending order, and total all but the highest 2, and output that number.

Clone this wiki locally