You are the sonar captain aboard an underwater submarine. The way sonar works is that every submarine sends out a ping at regular intervals. Each interval is a whole number of seconds. Each submarine has an identifying amplitude, that is no two submarines send out pings at the same amplitude. The amplitude is always a positive integer, so when two submarines send out pings at the same time, they constructively interfere and it appears on your ship's readout as a single ping at the sum of the amplitudes.
However, there are imposters in the deep sea. An imposter will send out pings at a different submarine's amplitude to imitate them. That means that when there's an imposter in the midst there will be two submarines pinging at the same amplitude.
If you see the following readout over a 10 second interval
0,1,1,0,1,1,0,1,1,0
Then you know there must be an imposter. The 1
pings don't occur at regular intervals.
However if you see the following:
0,3,3,0,3,3,0,3,3,0
You can't be certain there's an imposter. There might be an imposter imitating the 3
submarine:
0,3,0,0,3,0,0,3,0,0
0,0,3,0,0,3,0,0,3,0
Or there might be 3 submarines with two of them interfering:
0,1,0,0,1,0,0,1,0,0
0,2,0,0,2,0,0,2,0,0
0,0,3,0,0,3,0,0,3,0
Now the interference can make things pretty complicated. Can you tell quickly whether there's an imposter in the following readout:
5,7,5,3,9,4,5,7
It's possible, but it's also possible there's no imposter:
0,4,0,0,4,0,0,4
3,3,3,3,3,3,3,3
0,0,0,0,0,1,0,0
2,0,2,0,2,0,2,0
So you'd like to write a computer program which takes a readout and tells you quickly, without having to do any working by hand, whether there is definitely an imposter.
Task
Given a readout of your submarine's sonar as a list of non-negative integers, output a value if there is definitely an imposter, and output a different distinct value otherwise.
Your submarine is under a lot of pressure so your code should be pressurized as well. This is code-golf the goal is to minimize the size of your source code as measured in bytes.
Test cases
Imposter
[0,1,1,0,1,1,0,1,1,0]
[0,1,1]
[1,1,2]
[9,2,8,7,3,6,1,1]
[9,10,7,3,8,8,2,2]
[2,9,2,6,1]
Maybe imposter
[9]
[9,9]
[9,9,9]
[9,9,9,9]
[0,3,3]
[3,1,1]
[1,2,3,4,5,6,7,8]
[9,9,9,9,9,9,9,9,1]
[5,7,5,3,9,4,5,7]