#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, a[103];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    int ans = 1;
    for (int i = 0; i < n - 1; i++) {
      if (a[i + 1] - a[i] == 1) {
        ans++;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
