#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q, n, t = 0;
  cin >> q;
  for (int a = 0; a < q; a++) {
    t = 0;
    cin >> n;
    int e[n];
    for (int s = 0; s < n; s++) {
      cin >> e[s];
      for (int d = 0; d < s; d++) {
        if (e[s] - e[d] == 1 || e[s] - e[d] == -1) {
          t = 1;
          break;
        }
      }
    }
    if (t == 1) {
      cout << 2 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}
