title: programming puzzle : how to count number of bacteria that are alive?
body: <p>Recently, I had encountered an interesting programming puzzle which had some good twist and turn mentioned in the puzzle. Below the question which amazed me, I simply eager to know if any relevant solution probably in java is feasible for below scenario.</p>
  
  <p>Problem statement:
  There is a grid of dimension m*n, initially, a bacterium is present at the bottom left cell(m-1,0) of the grid with all the other cells empty. After every second, each bacteria in the grid divides itself and increases the bacteria count int the adjacent(horizontal,vertical and diagonal) cells by 1 and dies. </p>
  
  <p><strong>How many bacteria are present at the bottom right cell(m-1,n-1) after n-1 seconds?</strong> 
  I had taken references from 
  <a href="https://www.codechef.com/problems/BGH17" rel="nofollow noreferrer">https://www.codechef.com/problems/BGH17</a>
  but failed to submit the solution
  Below is the image for more insite of problem</p>
  
  <p><a href="https://i.stack.imgur.com/GWJmE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GWJmE.png" alt="enter image description here"></a></p>