Question bank › Graphs Dfs
Dsa Graphs Dfs Easy

Game Board Path

You are given a rectangular game board of cells, represented as a grid with 1s (available cell) and 0s (blocked cell). Write a program to count the number of distinct paths from the top-left cell to the bottom-right cell of the grid while only moving right or down. Input format: The first line contains two integers, rows and cols (1 <= rows, cols <= 20), the dimensions of the grid. The following lines contain the grid cells' values. Output the number of distinct paths from the top-left to the bottom-right corner. Example: Input: 3 3 1 0 1 1 1 1 1 1 1 Output: 2

Key concepts

graphsdfsgrid

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.