#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int q;
  cin >> q;
  while (q--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    long long int flag = 0;
    for (long long int i = 0; i < n; i++) {
      long long int x = arr[i];
      for (long long int j = i + 1; j < n; j++) {
        if (arr[j] == x + 1 || arr[j] == x - 1) {
          flag = 1;
        }
      }
    }
    if (flag) {
      cout << 2 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}
