7 kyu

Simple Fun #136: Missing Values

1,690 of 3,042myjinxin2015

Description:

Task

You are given a sequence of positive ints where every element appears three times, except one that appears only once (let's call it x) and one that appears only twice (let's call it y).

Your task is to find x * x * y.

Example

For arr=[1, 1, 1, 2, 2, 3], the result should be 18

3 x 3 x 2 = 18

For arr=[6, 5, 4, 100, 6, 5, 4, 100, 6, 5, 4, 200], the result should be 4000000

200 x 200 x 100 = 4000000

Input/Output

  • [input] integer array arr

an array contains positive integers.

  • [output] an integer

The value of x * x * y

Puzzles

Stats:

CreatedFeb 17, 2017
PublishedFeb 17, 2017
Warriors Trained4245
Total Skips33
Total Code Submissions6758
Total Times Completed3042
JavaScript Completions1690
C# Completions266
Ruby Completions230
Haskell Completions64
Julia Completions10
Python Completions853
Total Stars47
% of votes with a positive feedback rating94% of 502
Total "Very Satisfied" Votes447
Total "Somewhat Satisfied" Votes49
Total "Not Satisfied" Votes6
Total Rank Assessments8
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • Voile Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • stellartux Avatar
  • albertogcmr Avatar
  • ejini战神 Avatar
  • Just4FunCoder Avatar
Ad