jakaria_hossain

codeforce - diverse Strings

Mar 31st, 2019
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. cin>>n;
  7. while(n--)
  8. {
  9. string s;
  10. cin>>s;
  11. int x= s.size();
  12. int ara[x+1],i;
  13. for(i=0;i<x;i++)
  14. {
  15. ara[i]=s[i];
  16. }
  17. sort(ara,ara+x);
  18. for(i=0;i<x-1;i++)
  19. {
  20. if(ara[i]+1!=ara[i+1])break;
  21. }
  22. if(i==x-1)printf("Yes\n");
  23. else printf("No\n");
  24. }
  25. return 0;
  26. }
RAW Paste Data