#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x = 0;
  cin >> n;
  int m[n], a[n][101];
  for (i = 0; i < n; i++) {
    cin >> m[i];
    for (j = 0; j < m[i]; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m[i]; j++) {
      sort(a[i], a[i] + m[i]);
    }
  }
  for (i = 0; i < n; i++) {
    x = 0;
    for (j = 0; j < m[i] - 1; j++) {
      if (abs(a[i][j + 1] - a[i][j]) == 1) {
        x = 1;
        break;
      }
    }
    if (x == 1)
      cout << 2 << endl;
    else
      cout << 1 << endl;
  }
}
