7 kyu
Enumerable Magic #5- True for Just One?
1,886 of 4,313bellmyer
Description:
Task
Create a function called one
that accepts two params:
- a sequence
- a function
and returns true
only if the function in the params returns true
for exactly one (1
) item in the sequence.
Example
one([1, 3, 5, 6, 99, 1, 3], bigger_than_ten) -> true
one([1, 3, 5, 6, 99, 88, 3], bigger_than_ten) -> false
one([1, 3, 5, 6, 5, 1, 3], bigger_than_ten) -> false
If you need help, here is a resource ( in Ruby ).
Fundamentals
Similar Kata:
Stats:
Created | Nov 5, 2014 |
Published | Nov 5, 2014 |
Warriors Trained | 6634 |
Total Skips | 319 |
Total Code Submissions | 11346 |
Total Times Completed | 4313 |
Ruby Completions | 789 |
JavaScript Completions | 1886 |
C# Completions | 353 |
C Completions | 193 |
NASM Completions | 18 |
Python Completions | 1207 |
Haskell Completions | 76 |
Total Stars | 48 |
% of votes with a positive feedback rating | 92% of 861 |
Total "Very Satisfied" Votes | 755 |
Total "Somewhat Satisfied" Votes | 82 |
Total "Not Satisfied" Votes | 24 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |