6 kyu
Slices of a Series of Digits
313 of 417noku
Description:
Write a program that will take a string of digits and give you all the possible consecutive slices of length n
in that string.
Raise an error if n
is larger than the length of the string.
Examples
For example, the string "01234"
has the following 2-digit slices:
[0, 1], [1, 2], [2, 3], [3, 4]
The same string has the following 4-digit slices:
[0, 1, 2, 3], [1, 2, 3, 4]
Algorithms
Data Structures
Similar Kata:
Stats:
Created | Aug 24, 2014 |
Published | Aug 24, 2014 |
Warriors Trained | 689 |
Total Skips | 21 |
Total Code Submissions | 1884 |
Total Times Completed | 417 |
Ruby Completions | 117 |
Python Completions | 313 |
Total Stars | 7 |
% of votes with a positive feedback rating | 88% of 136 |
Total "Very Satisfied" Votes | 110 |
Total "Somewhat Satisfied" Votes | 19 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 41 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |