#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int i, count = 0;
    int a[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    for (i = 0; i <= n - 2; i++) {
      if (abs(a[i] - a[i + 1]) == 1) {
        count++;
        break;
      }
    }
    if (count == 0) {
      cout << "1";
    } else
      cout << "2";
    cout << endl;
  }
}
