practice problem solutions (may not be optimized) for cracking the coding interview, version 5