my attempted solutions for codingame.com