ZCO15001 breakup why is tis code giving a partially correct answer

beginner
c-plus-plus
zcohopeful

#1

This question is a part of the ZCO practice contest (question link) . I do not know where I’m going wrong ,please help.

#include<bits/stdc++.h>
using namespace std;
long N;
vector<long> numb;
int pal=0;
int palcheck(int k)
{
vector<long> rever;
int temp;
vector<long> rever2;
while(k<N) {
rever.push_back(numb[k]);
rever2=rever;
reverse(rever2.begin(),rever2.end());
if(rever==rever2){
temp=k+1;}
k++;
}
pal=pal+1;
return temp;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);	
cin >> N;
for (int i = 0; i < N; i++)
{int temp;
cin>>temp;
numb.push_back(temp);
}
int i=0;
while(i<N){
vector<long> rever;
vector<long> rever2;
int k=i;
while(k<N)
{
rever.push_back(numb[k]);
rever2=rever;
reverse(rever2.begin(),rever2.end());
if(rever==rever2){
i=k+1;}
k++;
}
pal=pal+1;
}
cout<<pal;
return 0;
}