Solve the robot walking possibility problem using O(n^2) DP.