물음표 살인마의 개발블로그

알고리즘 문제/CodeWar

Break camelCase

BEstyle 2022. 9. 26. 12:50

DESCRIPTION:

Complete the solution so that the function will break up camel casing, using a space between words.

Example

"camelCasing"  =>  "camel Casing"
"identifier"   =>  "identifier"
""             =>  ""

def solution(s):
    ans=''
    for i in s:
        if (ord(i)>=91):
            ans+=i
        else:
            ans+=' '+i
    print(ans)
    return ans

'알고리즘 문제 > CodeWar' 카테고리의 다른 글

Multiples of 3 or 5  (0) 2022.09.27
Area or Perimeter  (1) 2022.09.26
Count the smiley faces!  (1) 2022.09.26
Take a Ten Minutes Walk  (0) 2022.09.26
Detect Pangram  (0) 2022.09.26