Help me in solving CARDSWIPE problem

My issue

My code

#include <bits/stdc++.h>
using namespace std;
int b[200001];
int main() {
    int t;
    cin >>t;
    for(int i=0;i<t;i++){
        int n;
        cin >>n;
        int a[n];
        int l,m;
        l=0;
        m=0;
        for(int j=0;j<n;j++){
            cin >>a[j];
            b[a[j]]++;
            if(b[a[j]]%2!=0){
                m++;
            }
            else{
                m--;
            }
            l=max(l,m);
        }
        for(int j=0;j<n;j++){
            b[a[j]]=0;
        }
        cout<<l<<endl;
    }
	return 0;
}


Problem Link: CARDSWIPE Problem - CodeChef

for(int j=0;j<n;j++){
b[a[j]]=0;
} why we use this piece of code at end

@kumar_2330
to put back the values of b back to zero so that we can calculate for next test case