ProgrammingHardGATE CS · Campus placements
In a 3 x 3 grid, a walker can move only right or down from the top-left corner to the bottom-right corner. How many distinct paths exist?
- A. 4
- B. 20
- C. 6
- D. 10
Correct answer: C. 6
Each path has four moves, two right and two down, so the count is C(4,2) = 6. The DP table of paths gives the same value.
More C Programming questions
- T(0) = 0 and T(n) = T(n-1) + n for n >= 1. What is T(10)?
- What is gcd(48, 180) by Euclid's recursion?
- What is lcm(12, 18)?
- unsigned int u = 3; int s = -4; printf("%d", (int)u + s); What is printed?
- How many leading zero bits does the 16-bit unsigned value 0x0100 have?
- What is the popcount of (1ULL << 40) | (1ULL << 3)?