🎁 Exclusive Offer! Join our
Telegram Channel
to get **special discounts** and updates! 🚀
Question 47 - 100% Working Solution | Buy Now
Description
4 Live
A forklift operator navigates products within an automotive parts warehouse. The dashboard displays a real-time map showing open and blocked sections as an n x m matrix of 1's (open) and 0's (blocked). The operator starts at the top-left corner of the map at warehouse[0][0] and aims to reach the bottom-right corner at warehouse[n-1][m-1].
Movements can only be made to the right or downward. Given the warehouse map, calculate the number of distinct paths from warehouse[0][0] to warehouse[n-1][m-1]. Return the result modulo (10⁹+7).
Example
warehouse = [ [1, 1, 0, 1], [1, 1, 1, 1] ]
The matrix below is drawn from the warehouse array, showing open and blocked sections of the warehouse. 1 indicates an open section, and 0 indicates a blocked section. It is only possible to travel through open sections, so no path can go through the section at (0, 2).