Sort by

recency

|

40 Discussions

|

  • + 0 comments

    Python solution:

    from itertools import permutations
    
    pIter = permutations(n) if len(n)<3 else permutations(n,3)
    for k in pIter:
        if int(''.join(k)) & 7 == 0:
            return("YES")
    return("NO")
    
  • + 0 comments

    My Python code that passed all the test cases:

    def solve(n):
        if int(n) < 100:
            if int(n)%8 == 0 or int(n[::-1])%8 == 0:
                return "YES"
            return "NO"
                
        else:
            multiples_of_8 = []
            for i in range (0, 1000, 8):
                multiples_of_8.append(str(i).zfill(3))
                
            for e in multiples_of_8:
                if e[0] in n:
                    m = n.replace(e[0], '', 1)
                    if e[1] in m:
                        m = m.replace(e[1], '', 1)
                        if e[2] in m:
                            return "YES"
            return "NO"
    
  • + 1 comment

    Fails in 6312... the oficial solution is NO, but 2136 = 267 * 8 ...

  • + 0 comments

    Someone loves math, but I love my soul mate. Which I was lucky to get to know through https://www.fatflirt.com which made me happy every day. Now I know that finding your soul mate is real. The main thing is to try and seek.

  • + 0 comments

    Test Cases are weak