Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int num;
  cin >> num;
  vector<string> str;
  string s;
  for(int i=0;i<num;i++){
    cin >> s;
    sort(s.begin(),s.end());
    str.push_back(s);
  }
  long long cnt = 0;
  int same;
  while(str.size()!=0){
    same = 1;
    for(int i=str.size()-1;i>0;i--){
      if(str[0]==str[i]){
        same++;
        str.erase(i);
      }
    }
    cnt += same * (same-1) / 2;
    str.erase(0);
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::erase(int&)'
   22 |         str.erase(i);
      |         ~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
a.cc:26:14: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::erase(int)'
   26 |     str.erase(0);
      |     ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided