Domanda di colloquio di Optiver

First question involved some logical thinking and string handling.