TWO SIGMA Off Campus OA 2023 | Number of Ways to Stay in the Same Place After Some Steps | Dynamic Programming
Question · Posted Jun 2026
Problem Statement A pointer starts at index 0 in an array of length arrLen. At each step, the pointer can: Move one position to the left Move one position to the right Stay in the same position The pointer cannot move outside the array boundaries. Given two integers: steps → total number of moves arrLen → length of the array Return the number of ways to remain at index 0 after exactly steps moves. Since the answer can be very ...
The full answer & interview discussion are available to premium members.
Log in Create a free account