Given a target position, find the shortest sequence of 'A' (Advance) and 'R' (Reverse) instructions to reach the target. 'A' moves position by speed, speed doubles. 'R' reverses direction, speed…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.