Fun with Rotation
You are given an array A of N integers. You are to fulfill M queries. Each query has one of the following three types: - C d : Rotate the array A clockwise by d units. - A d : Rotate the array A anticlockwise by d units. - R d : Query for the value of the element, currently being the d-th in the array A. Input The first line contains two numbers - N and M respectively. The next line contains
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