#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i <= n - 1; i++) cin >> a[i];
    long long int ans = 0;
    long long int c = 0;
    for (long long int i = 0; i <= n - 1; i++) {
      c = 0;
      for (long long int j = 0; j <= n - 1; j++) {
        if (abs(a[i] - a[j]) == 1) c++;
      }
      ans = max(ans, c);
    }
    if (ans == 0)
      cout << 1 << endl;
    else
      cout << 2 << endl;
  }
}
