You are viewing a single comment's thread. Return to all comments →
//C++ code
int main()
{int n,a[100],i,h[100],max=0;
cin>>n; for(i=0;i<n;i++){ cin>>a[i]; } for(i=0;i<n;i++){ h[i]=0; } for(i=0;i<n;i++){ h[a[i]]++; } for(i=0;i<n-1;i++){ if( max<h[i]+h[i+1]) max=h[i]+h[i+1]; } cout<<max;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Picking Numbers
You are viewing a single comment's thread. Return to all comments →
//C++ code
int main()
{int n,a[100],i,h[100],max=0;
}