Question bank › Dynamic Programming
Dsa Dynamic Programming Easy

Min Steps to Target

You are a character in a grid starting at position (0, 0) and can move either right or down. Each move costs 1 step. Your goal is to reach the target position (m, n) in the minimum number of steps. You can only move to positions that are valid (i.e., within the bounds of the grid). Write a function to determine the minimum number of steps required to reach the target from the starting position. The input consists of two integers m and n. Output the minimum number of steps to reach (m, n). Example: Input: 2 3 Output: 5.

Key concepts

dynamic_programmingarraygreedy

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.