Retired
String array rotation (retired)
Description:
In this kata you will be given two argments: arr
which is an array that you will rotate, and k
which is the number of times you need to rotate arr
. One rotation of an array means taking the element at index 0 and moving it to the end of the array. After performing the rotations, return the array as a string with elements separated by spaces.
Examples:
rotate([1,2,3],2) => '3 1 2'
rotate([2,4,6,8,10,12,14],5) => '12 14 2 4 6 8 10'
rotate([],20) => ''
Additional Notes:
If k is less than a zero, return the array.
Fundamentals
Arrays
Data Types
Similar Kata:
Stats:
Created | Jun 13, 2019 |
Warriors Trained | 39 |
Total Skips | 0 |
Total Code Submissions | 112 |
Total Times Completed | 23 |
JavaScript Completions | 23 |
Total Stars | 0 |
% of votes with a positive feedback rating | 38% of 12 |
Total "Very Satisfied" Votes | 4 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 13 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |