Beta
Guess the list pattern #5
Description:
Make a function called "pattern" that takes an array and an integer as input and returns the correct pattern as an array.
Four examples are shown below:
pattern([1, 2, 3, 4, 5, 6, 7, 8], 5) = [8, 3, 5, 2, 1, 6, 7, 4]
pattern([5, 12, 78, 23, 70, 45, 54], 15) = [23, 78, 54, 12, 70, 45, 5]
pattern([4, 7, 8, 2, 5, -1, -9, 3], 21) = [8, 3, 2, -1, -9, 5, 4, 7]
pattern([56, 21, 57, 4, 9, 0, -2, -6], 650) = [56, 0, 4, 57, -6, 21, -2, 9]
Hint: Random
Fundamentals
Lists
Data Structures
Arrays
Puzzles
Similar Kata:
Stats:
Created | Sep 16, 2017 |
Published | Sep 16, 2017 |
Warriors Trained | 34 |
Total Skips | 0 |
Total Code Submissions | 4 |
Total Times Completed | 4 |
Ruby Completions | 4 |
Total Stars | 1 |
% of votes with a positive feedback rating | 33% of 3 |
Total "Very Satisfied" Votes | 1 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 3 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |