Ad
  • Default User Avatar

    Right... basically every solution that's using the "+111" or "i * 111" hack would miss 000.

  • Default User Avatar

    Test cases can't be edited anymore, more than 500 people have completed it :( Thanks for pointing out missing test case, would have loved to add it.

  • Custom User Avatar

    I was about to open an issue, too, but I think I meant the same, so I'll just comment here:

    The hardcoded test cases should include something like: TripleDouble(111L, 22L), which should return 0, because the digit is not the same in the triple and double.

    Although there are random test cases, they do not necessarily cover this case and some incorrect solutions pass.

  • Default User Avatar

    You're printing 0 instead of returning it

  • Custom User Avatar

    In my Python console triple_double(1222345, 12345) returns 0 but it fails on here. Any reason why?

    def triple_double(num1, num2):
        num1 = list(str(num1))
        num2 = list(str(num2))
    
        for digit in num1:
            if digit in num2 and num1.count(digit) >= 2 and num2.count(digit)>=2:
                return 1
        print 0
    
  • Default User Avatar

    None of the default test cases checks whether a different triple and double number passes a 0

  • Default User Avatar

    Incorrect solution since I didn't check whether the found numbers were the same...