Best solutions for problem 3 in testing_round_26