Find the unique number

User
Posted by anthonyo
1 year ago in Q/A Section
118 views
3 replies
User
anthonyo
Posted 1 year ago

There is an array with some numbers. All numbers are equal except for one. Try to find it!

```
findUniq([ 1, 1, 1, 2, 1, 1 ]) === 2
findUniq([ 0, 0, 0.55, 0, 0 ]) === 0.55
```

It’s guaranteed that array contains at least 3 numbers.

The tests contain some very huge arrays, so think about performance.

Image preview

Replies (2)

Please login to post a reply.

Thread Actions
Related Tags