← All problemsSign in

rotation left or right

In the initial Anuj facing a north direction . there is n element in array , n element contain Ai element where (i= 0 , 1 , 2 . . . <=N-1). Anuj will move according to following rule. ### Rules: - if A[i] > 0, then Anuj will turn 90 degree in clockwise direction (his right side) and move forward. - if A[i] < 0, then Anuj will turn 90 degree in anti clockwise

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start