6 kyu

Find the odd int

31,860 of 309,732rbuckley

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 Trained543191
Total Skips61659
Total Code Submissions827881
Total Times Completed309732
Java Completions31860
Haskell Completions2185
JavaScript Completions96279
Python Completions123275
Ruby Completions9231
TypeScript Completions5503
PHP Completions7297
C# Completions17954
F# Completions267
Clojure Completions604
NASM Completions80
CoffeeScript Completions44
Crystal Completions55
C++ Completions12610
Scala Completions838
Julia Completions184
Racket Completions92
Go Completions4246
Prolog Completions40
Elixir Completions309
Pascal Completions53
Swift Completions1108
Groovy Completions69
C Completions2753
COBOL Completions18
D Completions20
Factor Completions11
Rust Completions764
Total Stars4945
% of votes with a positive feedback rating90% of 25295
Total "Very Satisfied" Votes20642
Total "Somewhat Satisfied" Votes4268
Total "Not Satisfied" Votes385
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