#include using namespace std;  void countStringPairs(string a[], int n){          int ans = 0;              for (int i = 0; i < n; i++) {        for (int j = i + 1; j < n; j++) {                                      string p = a[i], q = a[j];                          if (p[0] != q[0]) {                  swap(p[0], q[0]);                int flag1 = 0;                int flag2 = 0;                                                  for (int k = 0; k < n; […]

Continue Reading