#include <bits/stdc++.h>
using namespace std;
int n, skill, team, i, temp, j, m, k, t, x, l, g;
int main() {
  int *skill;
  int *team;
  cin >> x;
  for (l = 0; l < x; l++) {
    n = 0;
    i = 0;
    temp = 0;
    j = 0;
    m = 0;
    k = 0;
    t = 0;
    cin >> n;
    team = new int[m];
    skill = new int[n];
    for (i = 0; i < n; i++) {
      cin >> skill[i];
    }
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        if (skill[j] < skill[i]) {
          temp = skill[i];
          skill[i] = skill[j];
          skill[j] = temp;
        }
      }
    }
    g = n;
    for (i = 0; i < g; i++) {
      k = n - 1;
      if (skill[k] - skill[k - 1] == 1) {
        cout << 2 << endl;
        t++;
        break;
      }
      n--;
    }
    if (t == 0) cout << 1 << endl;
  }
}
