#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc > 0) {
    unordered_set<int> datas;
    int anggota, penanda = 0;
    cin >> anggota;
    for (int i = 0; i < anggota; i++) {
      int input;
      cin >> input;
      datas.insert(input);
      if (datas.count(input - 1) == 1 || datas.count(input + 1) == 1) {
        penanda = 1;
      }
    }
    (penanda == 0) ? cout << 1 << endl : cout << 2 << endl;
    datas.erase(datas.begin(), datas.end());
    tc--;
  }
  return 0;
}
