This is my take at some puzzles and challenges on Codingame (https://www.codingame.com/).
Beware, some pieces of code are pretty old... :/