Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions week11/akinola/triple_double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Triple Double
Have the function TripleDouble(num1,num2) take both parameters being passed, and return 1 if there is a straight triple of a number at any place in num1 and also a straight double of the same number in num2. For example: if num1 equals 451999277 and num2 equals 41177722899, then return 1 because in the first parameter you have the straight triple 999 and you have a straight double, 99, of the same number in the second parameter. If this isn't the case, return 0.
10 changes: 10 additions & 0 deletions week11/akinola/triple_double.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def TripleDouble(num1,num2):
str1 = str(num1)
str2 = str(num2)
for t in str1:
if t*3 in str1 and t*2 in str2:
return 1
return 0

# keep this function call here
print TripleDouble(raw_input())