Available question text
Count the number of sequences of left/right/stay moves on a 1D array of length arrLen starting at index 0 that return to index 0 after exactly steps moves (answer modulo 1e9+7). This is a DP/counting problem over steps and positions — with steps ≤ 500 you can limit the positions considered to O(min(arrLen, steps)) to compute ways efficiently.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1269. Number of Ways to Stay in the Same Place After Some Steps
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source