Source Code
it=int(input())
for i in range(it):
    a =input()
    a= ''.join(sorted(a))
    if (ord(a[len(a)-1])-ord(a[0]))<=12:
        print("YES")
    else:
        print("NO")
Copy
Well-indexed? azoz1111111
Python 3
124 ms
3.1 MB
Wrong Answer