Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Rotate and Query a Ring

An array is treated as a ring. Process operations: R x rotates the array right by x, L x rotates it left by x, G i prints the element currently at index i. Do not physically move elements.

Constraints

1 <= n, q <= 10^5 0 <= x <= 10^9 0 <= i < n

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.