Coding challenges
In the following 15 coding challenges, we will exploit recursion and Dynamic Programming. These problems have been carefully crafted to help you understand and cover a wide range of problems from this category. By the end of this coding challenge session, you should be able to recognize and solve recursive problems in the context of an interview.
Coding challenge 1 – Robot grid (I)
Adobe, Microsoft
Problem: We have an m x n grid. A robot is placed at the top-left corner of this grid. The robot can only move either right or down at any point in time, but it is not allowed to move in certain cells. The robot's goal is to find a path from the top-left corner to the bottom-right corner of the grid.
Solution: First, we need to set some conventions of the m x n grid. Let's assume that the bottom-right corner has the coordinates (0, 0), while the top-left corner has the coordinates (m, n), where m is the row and n is the column of the grid. So...