Amazon OA
Anonymous User
1704

Got these questions in OA recently. Hope it will help someone.

1.Demolition robot
Determine the min distance required for the robot to remove the obstacle
Input is given as a 2D array which consists of 0, 1 and 9
9 is the obstacle, can pass through 1 and cannot pass through 0
Robot can move top, left, right and bottom

Input: [[1,0,0],[1,0,0],[1,9,1]]
output: 3

  1. i don't exactly remember the second one, it was like a Math tagged 1D dp problem

Solved 1st one with all test cases passed and attempted second one using recursion but TLE for many test cases

can i expect a call for next rounds if only solved one

Comments (2)