Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int n;
- string s;
- cin>>n>>s;
- vector<int> cnt(26);
- for(auto e: s)
- cnt[e-'a']++;
- ll int ans = 1;
- int MOD = 1e9 + 7;
- for(auto e: cnt)
- (ans *= (e+1)) %= MOD;
- cout<<(ans-1)<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment