7 kyu
Simple Sequence Validator
635 of 1,029shums16
Description:
Create a function that will return true if all numbers in the sequence follow the same counting pattern. If the sequence of numbers does not follow the same pattern, the function should return false.
Sequences will be presented in an array of varied length. Each array will have a minimum of 3 numbers in it.
The sequences are all simple and will not step up in varying increments such as a Fibonacci sequence.
JavaScript examples:
validateSequence([1,2,3,4,5,6,7,8,9]) === true
validateSequence([1,2,3,4,5,8,7,8,9]) === false
validateSequence([2,4,6,8,10]) === true
validateSequence([0,2,4,6,8]) === true
validateSequence([1,3,5,7,9]) === true
validateSequence([1,2,4,8,16,32,64]) === false
validateSequence([0,1,1,2,3,5,8,13,21,34]) === false
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Apr 28, 2015 |
Published | Apr 28, 2015 |
Warriors Trained | 1621 |
Total Skips | 128 |
Total Code Submissions | 3893 |
Total Times Completed | 1029 |
JavaScript Completions | 635 |
Python Completions | 422 |
Total Stars | 24 |
% of votes with a positive feedback rating | 92% of 228 |
Total "Very Satisfied" Votes | 194 |
Total "Somewhat Satisfied" Votes | 31 |
Total "Not Satisfied" Votes | 3 |