6 kyu

Find the odd int

7,329 of 311,981rbuckley

Description:

Given an array of integers, find the one that appears an odd number of times.

There will always be only one integer that appears an odd number of times.

Examples

[7] should return 7, because it occurs 1 time (which is odd).
[0] should return 0, because it occurs 1 time (which is odd).
[1,1,2] should return 2, because it occurs 1 time (which is odd).
[0,1,0,1,0] should return 0, because it occurs 3 times (which is odd).
[1,2,2,3,3,3,4,3,3,3,2,2,1] should return 4, because it appears 1 time (which is odd).

Fundamentals

Stats:

CreatedFeb 10, 2015
PublishedFeb 10, 2015
Warriors Trained546604
Total Skips61887
Total Code Submissions832130
Total Times Completed311981
Java Completions32040
Haskell Completions2201
JavaScript Completions96924
Python Completions124284
Ruby Completions9261
TypeScript Completions5570
PHP Completions7329
C# Completions18046
F# Completions267
Clojure Completions607
NASM Completions83
CoffeeScript Completions44
Crystal Completions55
C++ Completions12711
Scala Completions842
Julia Completions184
Racket Completions95
Go Completions4298
Prolog Completions40
Elixir Completions313
Pascal Completions53
Swift Completions1119
Groovy Completions69
C Completions2793
COBOL Completions18
D Completions20
Factor Completions11
Rust Completions794
Total Stars4964
% of votes with a positive feedback rating90% of 25364
Total "Very Satisfied" Votes20699
Total "Somewhat Satisfied" Votes4276
Total "Not Satisfied" Votes389
Ad
Contributors
  • rbuckley Avatar
  • jhoffner Avatar
  • Abbe Avatar
  • bkaes Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • ChristianECooper Avatar
  • suic Avatar
  • anter69 Avatar
  • brunolm Avatar
  • jfhs Avatar
  • samhstn Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • kleidemos Avatar
  • docgunthrop Avatar
  • Mazur213 Avatar
  • B1ts Avatar
  • Voile Avatar
  • metakata Avatar
  • mitron6 Avatar
  • Souzooka Avatar
  • 2Grey Avatar
  • andriyrom Avatar
  • hobovsky Avatar
  • ConstantineGochev Avatar
  • user3029010 Avatar
  • stellartux Avatar
  • trashy_incel Avatar
  • username0 Avatar
  • Wargrave Avatar
  • akar-0 Avatar
  • pastre Avatar
  • Kacarott Avatar
  • tri@ Avatar
  • Just4FunCoder Avatar
  • The43rdDev Avatar
Ad