Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- def something(s):
- con=Counter("doselect")
- c=Counter(s)
- flag=False
- for k,v in con.items():
- if k not in c:
- if v==1 and not flag and len(s)>7:
- flag=True
- continue
- else:
- return "NO"
- if c[k]-con[k]>=0:
- continue
- else:
- if flag:
- return "NO"
- if c[k]-con[k]==-1 and len(s)>7:
- flag=True
- else:
- return "NO"
- return "YES"
Advertisement
Add Comment
Please, Sign In to add comment