6 kyu
Travelling on a Grid
290 of 613mmalkavian
Description:
You have an 8x8 grid with coordinates ranging from 1
to 8
. The origin (1, 1)
is in the top left corner. The bottom right corner is (8, 8)
.
You are given a string as an input which will contain the 2 coordinates in this format: "(x1 y1)(x2 y2)"
, where (x1 y1)
represents point A
and (x2 y2)
represents point B
. In the inputs provided, point A
will always be up and to the left of point B
. In other words, x1 < x2
and y1 < y2
will be true for every input.
Your goal is to find out the number of different paths you can take to get from point A
to point B
by moving one cell at a time either down or right.
Example
Given an input of "(2 3)(3 5)"
, the number of possible paths to get from A
to B
is 3.
. . . . . . . .
. . . . . . . .
. A . . . . . .
. . . . . . . .
. . B . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
Possible paths, marked with x
:
A . A . A x
x . x x . x
x B . B . B
Puzzles
Algorithms
Similar Kata:
Stats:
Created | Dec 5, 2016 |
Published | Dec 5, 2016 |
Warriors Trained | 1653 |
Total Skips | 68 |
Total Code Submissions | 1677 |
Total Times Completed | 613 |
Python Completions | 290 |
JavaScript Completions | 190 |
Java Completions | 134 |
Ruby Completions | 25 |
Haskell Completions | 12 |
Total Stars | 58 |
% of votes with a positive feedback rating | 89% of 151 |
Total "Very Satisfied" Votes | 124 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |