You are located at a given point of a grid (m*n) , and you need to reach the bottom-right corner of the grid. Let us choose point (1*1) of the grid as the starting point:

You are at position 1 ( 1*1) and you need to move to position marked STOP

Question: How many possible paths can you take to get to your destination? ( Note: You can only move RIGHT or DOWN from any given point)

Before we write our program, let us visualize the solution on the grid.
Fill all the cells of the first row and the first…

John Wanjala

After all chatter and natter, work must be done and problems solved for the good of humankind; and doers duly appreciated.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store