공백이 여러 개 있는 테스트 케이스 있다는 게 맞는 말인듯. s.title() 내장함수 쓰는 것도 방법인데, 이렇게 풀어보았다.



def solution(s):

    

    is_first = True

    answer = []

    

    for c in s:

        if c == " ":

            is_first = True

        else:

            if is_first:

                c = c.upper()

                is_first = False

            else:

                c = c.lower()

        answer.append(c)

        

    return "".join(answer)