For this challenge you will be given a list of integers that is supposed to form a continuous range from A to B, but:

A and B are unknown.

Exactly one integer is missing from within the sequence.

Exactly one integer appears twice.

The array may contain extra random noise values outside the range. (It is possible that the noise values could form a mini-sequence, but the noise sequence will be shorter than the primary sequence)

The challenge is to determine the start value, end value, missing value and duplicate value.

Here are some examples:

Example 1:

[5, 9, 7, 6, 7, 4, 100, -2]

Start value: 4

End value: 9

Missing value: 8

Duplicate value: 7

Noise: -2, 100

Example 2:

[4, 5, 6, -1, 8, 8, -2, -3, -2]

Start value: 4

End value: 8

Missing value: 7

Duplicat…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help