Solution to checkio.org problems