Common algorithm problem solutions