My solutions for the codingame in PHP