#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v1;
    for (long long int i = 0; i < n; i++) {
      long long int j;
      cin >> j;
      v1.push_back(j);
    }
    long long int c = 0;
    for (long long int i = 0; i < v1.size() - 1; i++) {
      for (long long int j = i + 1; j < v1.size(); j++) {
        if (abs(v1[i] - v1[j]) == 1) {
          c++;
        }
      }
    }
    if (c > 0)
      cout << 2 << endl;
    else
      cout << 1 << endl;
  }
}
