7 kyu
Jumps in a cycle #1
228 of 323Donvito-911
Description:
Jumps in a cycle
A cycle can be written in a extended form with a jump rate equal to 1 as
Given a jump rate k
and starting in the first element, you must find the number of jumps you have to take in order to reach the same element.
ASSUMPTION: The elements in the cycle are distinguishable.
Examples
[1, 5, 7, 8, 9] and jump rate 1, then . That is, 5 jumps.
[1, 5, 7, 8, 9] and jump rate 2, then . That is, 5 jumps.
[1, 5, 1] and jump rate 2, then . That is, 3 jumps.
Input
- cl: (list) the list with the cycle.
- k: (int) the jump rate.
Output
(int) The number of jumps in order to reach the same first element in the cycle.
Mathematics
Puzzles
Performance
Similar Kata:
Stats:
Created | Feb 24, 2023 |
Published | Feb 26, 2023 |
Warriors Trained | 1287 |
Total Skips | 26 |
Total Code Submissions | 3583 |
Total Times Completed | 323 |
Python Completions | 228 |
C++ Completions | 77 |
Rust Completions | 40 |
Factor Completions | 7 |
Total Stars | 22 |
% of votes with a positive feedback rating | 81% of 68 |
Total "Very Satisfied" Votes | 48 |
Total "Somewhat Satisfied" Votes | 14 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 11 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |