Count of distinct groups of strings formed after performing equivalent operation

#include using namespace std;  int Find(vector& parent, int a){    return parent[a]           = (parent[a] == a ? a : Find(parent, parent[a]));}  void Union(vector& parent,           vector& rank, int a,           int b){          a = Find(parent, a);    b = Find(parent, b);          if (rank[a] == rank[b])        rank[a]++;    if (rank[a] > rank[b])        parent[b] = a;    else        parent[a] = b;}  void numOfDistinctStrings(string arr[],                          int N){            vector parent(27);          vector rank(27, 0);      for (int j = 0; j < 27; j++) {                parent[j] = j;    }              vector total(26, false);              vector current(26, false);      for (int i = 0; i < N; i++) {          for (int j = 0; j < 26; j++) {                          current[j] = false;        }          for (char ch : arr[i]) {                          current[ch - 'a'] = true;        }          for (int j = 0; j < 26; j++) {                          if (current[j]) {                                  total[j] = true;                                                  Union(parent, rank,                      arr[i][0] - 'a', j);            }        }    }          int distCount = 0;    for (int i = 0; i < 26; i++) {                          if (total[i] && Find(parent, i) == i) {                                      distCount++;        }    }          cout