프로그래밍/HackerRank
[HackerRank][Python3] CamelCase
snoopybox
2018. 5. 27. 02:53
Problem :
https://www.hackerrank.com/challenges/camelcase/problem
My Solution :
#!/usr/bin/env python3
def camelcase(s):
ret = 1
for c in s:
if 65 <= ord(c) < 91:
ret += 1
return ret
s = input()
result = camelcase(s)
print(result)
My Solution2 :
#!/usr/bin/env python3
def camelcase(s):
return sum(map(lambda c:c.isupper(), s)) + 1
s = input()
result = camelcase(s)
print(result)