← All problemsSign in

Count Paths

You have a N x M matrix of cells. The cell (i, j) represents the cell at row i and column j. You can go from one cell (i, j) only down or right, that is to cells (i + 1, j) or (i, j + 1). But K cells are blocked in the matrix(you can’t visit a blocked cell). You are given coordinates of all these cells. You have to count number of ways to reach cell (N, M) if you begin at cell (1, 1). Two ways

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start