Triple Double

Write a function that take 2 parameters being passed, and return true 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. Otherwise, return false.

For example, if num1 is 451999277 and num2 is 41177722899, then return true.

451999277 has triple (three) 9's

41177722899 has double (two) 9's

Have fun!

def tripleDouble(num1, num2)
  # your magic here
end

results matching ""

    No results matching ""