Language: C++

#include<iostream>
#include<bits/stdc++.h>

using namespace std;

long long int NcR(int n, int r) 
{ 
  
    // p holds the value of n*(n-1)*(n-2)..., 
    // k holds the value of r*(r-1)... 
    long long p = 1, k = 1; 
  
    // C(n, r) == C(n, n-r), 
    // choosing the smaller value 
    if (n - r < r) 
        r = n - r; 
  
    if (r != 0) { 
        while (r) { 
            p *= n; 
            k *= r; 
  
            // gcd of p, k 
            long long m = __gcd(p, k); 
  
            // dividing by gcd, to simplify product 
            // division by their gcd saves from the overflow 
            p /= m; 
            k /= m; 
  
            n--; 
            r--; 
        } 
  
        // k should be simplified to 1 
        // as C(n, r) is a natural number 
        // (denominator should be 1 ) . 
    } 
  
    else
        p = 1; 
  
    // if our approach is correct p = ans and k =1 
    return p; 
} 

int main() {
  int n;
  string s;
  map<string, long long int> store;
  long long int result = 0;
  cin>>n;
  while(n--) {
    cin>>s;
    store[sort(s.begin(), s.end())]++;
  }
  for(auto it=store.begin();it!=store.end();it++) {
    if(it->second>1) result+=NcR(it->second, 2);
  }
  cout<<result;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:55:10: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, long long int>' and 'void')
   55 |     store[sort(s.begin(), s.end())]++;
      |          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = long long int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> >; mapped_type = long long int; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'void' to 'const std::map<std::__cxx11::basic_string<char>, long long int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = long long int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> >; mapped_type = long long int; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'void' to 'std::map<std::__cxx11::basic_string<char>, long long int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~