th0m45s5helby

Untitled

Sep 26th, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. from collections import Counter
  2.  
  3. def something(s):
  4.    
  5.     con=Counter("doselect")
  6.     c=Counter(s)
  7.     flag=False
  8.     for k,v in con.items():
  9.         if k not in c:
  10.             if v==1 and not flag and len(s)>7:
  11.                 flag=True
  12.                 continue
  13.             else:
  14.                 return "NO"
  15.         if c[k]-con[k]>=0:
  16.             continue
  17.         else:
  18.             if flag:
  19.                 return "NO"
  20.             if c[k]-con[k]==-1 and len(s)>7:
  21.                 flag=True
  22.             else:
  23.                 return "NO"
  24.     return "YES"
Advertisement
Add Comment
Please, Sign In to add comment