You are viewing a single comment's thread. Return to all comments →
int main() {
int n,d,f,j,i,*ar; cin>>n>>d; ar=new int[n]; for(i=0;i<n;i++){ cin>>ar[i]; } for(i=1;i<=d;i++){ f=ar[0]; for(j=0;j<n-1;j++){ ar[j]=ar[j+1]; } ar[n-1]=f; } for(i=0;i<n;i++){ cout<<ar[i]; if(i<(n-1)){ cout<<" "; } } return 0;
} test case#8 is showing "terminated due to timeout"! Any suggestions? i am new to this!
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
int main() {
} test case#8 is showing "terminated due to timeout"! Any suggestions? i am new to this!