#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int test_case;
  int team_cnt = 0;
  int arr[101];
  cin >> test_case;
  while (test_case--) {
    team_cnt = 1;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (abs(arr[i] - arr[j]) == 1) {
          team_cnt++;
          if (team_cnt > 2) {
            team_cnt = 2;
          }
        }
      }
    }
    cout << team_cnt << endl;
  }
}
