#include <bits/stdc++.h>
int main() {
  int n, m, a[100], i, j, t = 1;
  while (scanf("%d", &n) != EOF) {
    while (n--) {
      t = 1;
      scanf("%d", &m);
      for (i = 0; i < m; i++) scanf("%d", &a[i]);
      for (i = 0; i < m; i++)
        for (j = i + 1; j < m; j++) {
          if (fabs(a[j] - a[i]) == 1) t = 2;
        }
      printf("%d\n", t);
    }
  }
  return 0;
}
