Untitled

mail@pastecode.io avatar
unknown
c_cpp
3 years ago
395 B
1
Indexable
Never
 int c[26] = {0};
        int x = s.size();
        int y = t.size();
        
        for(int i = 0; i < x; i++){
            c[s[i]-'a']++;
        }
        
        for(int i = 0; i < y;i++){
            c[s[i]-'a']--;
        }
        
        for(int i = 0; i < 26; i++){
            if(c[i] != 0) 
                return 0;
            break;
        }
        return 1;