You are given a board of size M x N where each cell can be either empty(0) or a wall(X). A robot is initially placed at the cell on the top left corner and has to visit all the empty cells on the board that it can reach by either walking straight or backward or by taking 90 turns, i.e. it cannot move diagonally. Print the maximum number of cells the robot can visit.
Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings anywhere in the program, as these contribute to the standard output and testcases will fail.
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.