#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t != 0) {
    int n = 0;
    cin >> n;
    vector<int> v;
    v.resize(n);
    for (int i = 0; i < n; i++) {
      cin >> v[i];
    }
    int count = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (v[i] - v[j] == 1 || v[i] - v[j] == -1) count++;
      }
    }
    if (count == 0) {
      cout << "1" << endl;
    } else
      cout << "2" << endl;
    t--;
  }
}
