[HackerRank][Python3] Jumping on the Clouds
2018. 9. 6. 01:04 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/jumping-on-the-clouds/problem
My Solution :
#!/usr/bin/env python3
def jumping_on_clouds(c):
count = i = 0
while i < len(c)-1:
count += 1
if i+2 < len(c) and c[i+2]:
i += 1
else:
i += 2
return count
n = int(input())
c = list(map(int, input().rstrip().split()))
result = jumping_on_clouds(c)
print(result)
'프로그래밍 > HackerRank' 카테고리의 다른 글
| [HackerRank][Python3] Halloween Sale (0) | 2018.09.06 |
|---|---|
| [HackerRank][Python3] Minimum Distances (0) | 2018.09.06 |
| [HackerRank][Python3] Beautiful Triplets (0) | 2018.09.06 |
| [HackerRank][Python3] Equalize the Array (0) | 2018.09.06 |
| [HackerRank][Python3] Sequence Equation (0) | 2018.09.05 |
| [HackerRank][Python3] String Construction (0) | 2018.09.05 |
| [HackerRank][Python3] Beautiful Binary String (0) | 2018.09.05 |
| [HackerRank][Python3] Separate the Numbers (0) | 2018.09.04 |
최근에 달린 댓글 최근에 달린 댓글