#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int ans = 1;
    set<int> myset;
    for (int i = 0; i < n; i++) {
      int c;
      cin >> c;
      if (myset.count(c + 1) || myset.count(c - 1)) ans = 2;
      myset.insert(c);
    }
    cout << ans << endl;
  }
}
