Created
January 11, 2014 19:51
-
-
Save andreasnilsson/8375855 to your computer and use it in GitHub Desktop.
to fille
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
lines = [] | |
for line in sys.stdin: | |
lines.append(line) | |
numbers = map(int, lines[1].split()) | |
max = numbers[-1] | |
min = numbers[0] | |
delta = (max-min) / (len(numbers)) | |
for i in range(1, len(numbers)): | |
expected = numbers[i-1] + delta | |
if numbers[i] != expected: | |
print expected | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment