7 kyu

Array element parity

4,091 of 9,801KenKamau

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

Stats:

CreatedNov 13, 2017
PublishedNov 24, 2017
Warriors Trained15389
Total Skips247
Total Code Submissions25535
Total Times Completed9801
JavaScript Completions4091
Python Completions3010
Ruby Completions290
C# Completions549
Haskell Completions121
C Completions194
Elixir Completions41
C++ Completions589
Java Completions872
Go Completions298
Rust Completions139
Clojure Completions29
OCaml Completions8
Total Stars151
% of votes with a positive feedback rating94% of 1433
Total "Very Satisfied" Votes1272
Total "Somewhat Satisfied" Votes145
Total "Not Satisfied" Votes16
Total Rank Assessments3
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • raulbc777 Avatar
  • imjasonmiller Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • rsa Avatar
  • hobovsky Avatar
  • solitude Avatar
  • username0 Avatar
  • DVYKPABQDG Avatar
  • mauro-1 Avatar
  • KayleighWasTaken Avatar
  • PetitLu117 Avatar
Ad