Just saw video tutorial and tried to implement MFREQ question…

can anyone tell me what am I missing at?

here is my code:

#include using namespace std; int main() { int n,m; cin>>n>>m; long long a[n],left[n],right[n]; for(int i=0;i>a[i]; for(int i=0;i>l>>r>>k; left[0]=0; for(int i=1;i=0;i--) { if(a[i]==a[i+1]) right[i]=i+1; else right[i]=i; } for(int i=0;i<n;i++) cout<<left[i]<<" "; //left array cout<<endl; for(int i=0;i<n;i++) cout<<right[i]<=k) // not getting this condition cout<<a[mid]<<endl; else cout<<-1<<endl; } }

Please help me…