7 kyu
Array element parity
3,987 of 9,459KenKamau
Description:
In this Kata, you will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive. Your task will be to find that integer.
Examples:
[1, -1, 2, -2, 3] => 3
3
has no matching negative appearance
[-3, 1, 2, 3, -1, -4, -2] => -4
-4
has no matching positive appearance
[1, -1, 2, -2, 3, 3] => 3
(the only-positive or only-negative integer may appear more than once)
Good luck!
Arrays
Algorithms
Similar Kata:
Stats:
Created | Nov 13, 2017 |
Published | Nov 24, 2017 |
Warriors Trained | 14892 |
Total Skips | 245 |
Total Code Submissions | 24562 |
Total Times Completed | 9459 |
JavaScript Completions | 3987 |
Python Completions | 2890 |
Ruby Completions | 285 |
C# Completions | 532 |
Haskell Completions | 119 |
C Completions | 183 |
Elixir Completions | 38 |
C++ Completions | 563 |
Java Completions | 830 |
Go Completions | 275 |
Rust Completions | 131 |
Clojure Completions | 29 |
Total Stars | 142 |
% of votes with a positive feedback rating | 94% of 1414 |
Total "Very Satisfied" Votes | 1255 |
Total "Somewhat Satisfied" Votes | 144 |
Total "Not Satisfied" Votes | 15 |
Total Rank Assessments | 3 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |