My solution on checkio, including some brilliant implement of others.