#include <bits/stdc++.h>
using namespace std;
int compare(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int main() {
  int q;
  cin >> q;
  while (q--) {
    int a[100], i, n, ok = 0;
    cin >> n;
    for (i = 1; i <= n; i++) cin >> a[i];
    if (n == 1) ok = -1;
    for (i = 1; i < n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (a[i] > a[j]) {
          int aux = a[i];
          a[i] = a[j];
          a[j] = aux;
        }
      }
    }
    for (i = 1; i < n; i++) {
      if (a[i + 1] - a[i] == 1) {
        ok++;
        break;
      }
    }
    if (ok == 1)
      cout << 2 << endl;
    else
      cout << 1 << endl;
  }
}
