Skip to content

Commit 526acd3

Browse files
committed
1 parent c894753 commit 526acd3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

solutions/Luck_check.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Luck check
3+
http://www.codewars.com/kata/5314b3c6bb244a48ab00076c/train/python
4+
"""
5+
6+
7+
def luck_check(string):
8+
i, j, total = 0, len(string) - 1, 0
9+
while i != j and i < j:
10+
total += (int(string[i]) - int(string[j]))
11+
i += 1
12+
j -= 1
13+
return total == 0

0 commit comments

Comments
 (0)