#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  for (int times = 0; times < q; ++times) {
    int n;
    cin >> n;
    vector<int> vec(n, 0);
    for (int i = 0; i < n; ++i) {
      cin >> vec[i];
    }
    int res = 1;
    for (int i = 0; i < n; ++i) {
      for (int j = i + 1; j < n; ++j) {
        if (abs(vec[i] - vec[j]) == 1) {
          res++;
        }
      }
    }
    if (res > 2) res = 2;
    cout << res << endl;
  }
  return 0;
}
