#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  while (n--) {
    int num = 0;
    cin >> num;
    int arr[num];
    for (int i = 0; i < num; i++) cin >> arr[i];
    int count = 0;
    for (int i = 0; i < num; i++) {
      int k = arr[i];
      for (int j = i; j < num - 1; j++) {
        if (arr[i] - arr[j + 1] == 1 || arr[i] - arr[j + 1] == -1) {
          count++;
          break;
        }
      }
    }
    if (count == 0)
      cout << 1 << "\n";
    else
      cout << 2 << "\n";
  }
}
