Company: Flipkart_12july
Difficulty: medium
Count Reachable Cells Problem Description You are given a board of size M X N where each cell can be either empty(O) 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. Find the maximum number of cells the robot can visit. Input Format: The first line of input has two integers, M and N, the size of the board. Next M lines have N characters, either 'X' or 'O', where O represents the empty cell and X represents the wall. Output Format: A single line of output has the 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. Examples Example 1: Input: 4 3 OXO OOX XOO OOO Output: 8 Explanation: The board is given below. The shaded cells represent