Retired
Non-consecutive Pairs (retired)
Description:
Write a function to identify all non-consecutive pairs in an array.
The function should return a nested array of pairs.
Example # 1
non_consec_pairs(['a', 'b', 'c'])
=> [['a', 'c']]
In this example 'a' & 'b' are consecutive, as are 'b' & 'c'.
Leaving only one non-consecutive pairing that can be made; 'a' & 'c'.
Example # 2
non_consec_pairs([1, 2, 3, 4])
=> [[1, 3], [1, 4], [2, 4]]
Note
The input will always be flat a array but the contents and size will vary
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Aug 1, 2017 |
Warriors Trained | 136 |
Total Skips | 31 |
Total Code Submissions | 160 |
Total Times Completed | 34 |
Ruby Completions | 34 |
Total Stars | 1 |
% of votes with a positive feedback rating | 67% of 18 |
Total "Very Satisfied" Votes | 10 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 18 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |