#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t;
  cin >> t;
  while (t--) {
    int num;
    cin >> num;
    set<int> s;
    int flag = 0;
    while (num--) {
      int temp;
      cin >> temp;
      if (flag == 1) continue;
      if (s.find(temp - 1) != s.end() || s.find(temp + 1) != s.end())
        flag = 1;
      else
        s.insert(temp);
    }
    if (flag == 1)
      cout << 2 << "\n";
    else
      cout << 1 << "\n";
  }
  return 0;
}
