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 arrayarr
an array contains positive integers.
[output]
an integer
The value of x * x * y
Puzzles
Similar Kata:
Stats:
Created | Feb 17, 2017 |
Published | Feb 17, 2017 |
Warriors Trained | 4245 |
Total Skips | 33 |
Total Code Submissions | 6758 |
Total Times Completed | 3042 |
JavaScript Completions | 1690 |
C# Completions | 266 |
Ruby Completions | 230 |
Haskell Completions | 64 |
Julia Completions | 10 |
Python Completions | 853 |
Total Stars | 47 |
% of votes with a positive feedback rating | 94% of 502 |
Total "Very Satisfied" Votes | 447 |
Total "Somewhat Satisfied" Votes | 49 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 8 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |