6 kyu
Does array x contain all values within array y?
1,859 of 2,778jhoffner
Description:
We want to extend the array class so that it provides a contains_all?
method. This method will always assume that an array is passed in and will return true
if all values in the passed in array are present within the current array.
For example:
items = [1, 2, 3, 4, 5, 6, 7, 8, 9]
items.contains_all?([1, 2, 3]) # should == true
items.contains_all?([1, 5, 13]) # should == false because 13 is not in the items array
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Mar 16, 2013 |
Published | Jun 24, 2013 |
Warriors Trained | 4392 |
Total Skips | 498 |
Total Code Submissions | 10105 |
Total Times Completed | 2778 |
Ruby Completions | 1859 |
CoffeeScript Completions | 21 |
C++ Completions | 313 |
JavaScript Completions | 514 |
Total Stars | 38 |
% of votes with a positive feedback rating | 92% of 241 |
Total "Very Satisfied" Votes | 208 |
Total "Somewhat Satisfied" Votes | 28 |
Total "Not Satisfied" Votes | 5 |