Problem 118 (python): underway, but inefficient strategy needs to be fixed