#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <map>
using namespace std;
using lol = long long;
using namespace std;

int calc(vector<int> a)
{
    int res = 0;
    vector<int> b;
    while (!a.empty())
    {
        for (int i = 1; i < a.size(); i++)
            if (a[i] == a[i - 1])
                b.push_back(a[i]);
        a = b;
        b.clear();
        ++res;
    }
    return res;
}

int main()
{
    //freopen("inp.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t, n;
    cin >> t;
    while (t--)
    {
        int d = 1;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++)
            cin >> a[i];
        cout << calc(a) << '\n';
    }
}
