• + 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")