@4censord this was the very first CS problem I solved, before I even started learning CS! It was quite funny to realise — years later, in my professional career — that this actually is one of those fundamental CS things.
@4censord Come on, I wrote a program for what I found later was the optimal implementation when I was like twelve, still arguably a game for children :P