Array Rotation
CodeChefOpen on judge ↗
You are given an array A of N integers. You are to fulfill M queries. Each query has one of the following three types: - L d : Rotate the array A to the left by d units. - R d : Rotate the array A to the right by d units. - Q d : Query the element currently at the d-th index in the array, after all earlier rotations have been carried out. ###Input: The first line contains two numbers - N and M
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start