Array rotation?

in this how to perform the operation when the k is greater then n??help?

this works fine on sample.
int n,k;
cin>>n>>k;
int a[n];
foi(n)
cin>>a[i];
for(int i=n-k;i<=n+k;i++)
cout<<a[i%n]<<" ";

Link ???
Is this ongoing contest ?

no but this link needs logging in

Without that We can’t help you then. Sorry.

Please post the link of the question :slight_smile: . It’s alright if it needs logging in . People will be more likely to help if they are sure this is not a question from some ongoing contest

1 Like

Seems like he read these comments.
He not giving link after reading our comments make me more suspicious that it was indeed an ongoing contest.

1 Like

It was from an Ongoing contest.

1 Like

Which one ?

@l_returns Some Hackerearth Hiring Contest most probably.

3 Likes

Wow Karan is back ?

3 Likes

This is a platform, where he is doing questions, this platform belongs to prepbytes.com.

everyone is not as active as others…

Not active for his own post ?

2 Likes

thank you one and all for your support !! sorry for not giving reply i was a bit busy…

this is the link but i cant understand why all of you are mainly focused on asking the link??

1 Like

to stop people from cheating.

3 Likes