[HackerRank][Python3] CamelCase
2018. 5. 27. 02:53 |
프로그래밍/HackerRank
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)
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] The Power Sum (1) | 2018.05.31 |
---|---|
[HackerRank][Python3] Construct the Array (0) | 2018.05.30 |
[HackerRank][Python3] Minimum Absolute Difference in an Array (0) | 2018.05.29 |
[HackerRank][Python3] Big Sorting (0) | 2018.05.29 |
[HackerRank][Python3] Journey to the Moon (0) | 2018.05.25 |
[HackerRank][Python3] Hackerland Radio Transmitters (0) | 2018.05.23 |
[HackerRank][Python3] Sherlock and Cost (0) | 2018.05.21 |
[HackerRank][Python3] Maximum Subarray Sum (0) | 2018.05.18 |
최근에 달린 댓글 최근에 달린 댓글