int count[N][N] = {0}; where N is a value received at runtime. I am unable to figure out why this one element is initializing to this value. Below I have added the code it is included in just in case if it is being affected by anything else. Thank you already.enter image description here
string s;
cin>>s;
set<char> setStr;
string unique;
vector<int> numStr;
for(auto c: s) setStr.insert(c);
for(auto x: setStr) unique.push_back(x);
for(auto c: s) numStr.push_back(unique.find(c));
int N = (int) unique.size();
int pair[N][N] = {-1};
int count[N][N] = {0};
cout<<endl;
for(auto n: numStr)
{
for(int col=0;col<N;++col)
{
if(pair[n][col]==n) count[n][col]=-1;
if(count[n][col]!=-1)
{
pair[n][col]=n;
++count[n][col];
}
}
for(int row=0;row<N;++row)
{
if(pair[row][n]==n) count[row][n]=-1;
if(count[row][n]!=-1)
{
pair[row][n]=n;
++count[row][n];
}
}
}