__________________________________________________

**Top Companies Interview Questions..-**

Microsoft | Amazon | more.. |

If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment.

__________________________________________________

### Related Posts:

- Graph – Count all paths between source and destination
- Dynamic Programming – Count all paths from top left to bottom right of a mXn matrix
- Graph – Print all paths between source and destination
- Dynamic Programming – Count all paths in 2D Matrix with Obstructions in it
- Find longest Snake sequence in a given matrix
- Djkstra’s – Shortest Path Algorithm (SPT)
- Top 40 Interview Problems on Arrays
- Top 25 Interview Problems on Binary Trees/Binary Search Trees