7 kyu

Sum of array singles

4,611 of 14,848KenKamau

Description:

In this Kata, you will be given an array of numbers in which two numbers occur once and the rest occur only twice. Your task will be to return the sum of the numbers that occur only once.

For example, repeats([4,5,7,5,4,8]) = 15 because only the numbers 7 and 8 occur once, and their sum is 15. Every other number occurs twice.

More examples in the test cases.

Good luck!

If you like this Kata, please try:

Sum of prime-indexed elements

Sum of integer combinations

Algorithms

More By Author:

Check out these other kata created by KenKamau

Stats:

CreatedOct 25, 2017
PublishedOct 25, 2017
Warriors Trained21235
Total Skips293
Total Code Submissions31769
Total Times Completed14848
Python Completions4611
JavaScript Completions5090
Ruby Completions422
R Completions142
C# Completions749
Haskell Completions143
C++ Completions2410
Rust Completions195
Factor Completions12
Java Completions1142
Clojure Completions27
Kotlin Completions357
Prolog Completions20
Total Stars176
% of votes with a positive feedback rating94% of 1801
Total "Very Satisfied" Votes1609
Total "Somewhat Satisfied" Votes170
Total "Not Satisfied" Votes22
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • KenKamau Avatar
  • imjasonmiller Avatar
  • B1ts Avatar
  • Voile Avatar
  • Souzooka Avatar
  • mentalplex Avatar
  • rsa Avatar
  • metagn Avatar
  • booniepepper Avatar
  • hobovsky Avatar
  • Zordid Avatar
  • username0 Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • Kacarott Avatar
  • saudiGuy Avatar
Ad