CodeEval Beautiful Strings solution