basic solutions. substitution does not iteratively solve last char