7 kyu
Enumerable Magic #5- True for Just One?
1,260 of 4,426bellmyer
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 | 6792 |
Total Skips | 323 |
Total Code Submissions | 11596 |
Total Times Completed | 4426 |
Ruby Completions | 793 |
JavaScript Completions | 1926 |
C# Completions | 358 |
C Completions | 207 |
NASM Completions | 19 |
Python Completions | 1260 |
Haskell Completions | 79 |
Total Stars | 51 |
% of votes with a positive feedback rating | 92% of 876 |
Total "Very Satisfied" Votes | 767 |
Total "Somewhat Satisfied" Votes | 84 |
Total "Not Satisfied" Votes | 25 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |