Skip to content

Instantly share code, notes, and snippets.

@popey456963
Created October 25, 2015 16:27
Show Gist options
  • Save popey456963/6326a2f11724f6bc6425 to your computer and use it in GitHub Desktop.
Save popey456963/6326a2f11724f6bc6425 to your computer and use it in GitHub Desktop.
Odd One Out
numbers = input().split(" ")
j = []
for i in numbers:
j.append(int(i))
count = 0
for i in j:
if i < 0:
count = count - 1
else:
count = count + 1
if count > 0:
print(min(j))
if count < 0:
print(max(j))
@popey456963
Copy link
Author

j=[int(i) for i in input().split(" ")]
c=0
for i in j:
 c+=(1,-1)[i<0]
if c>0:print(min(j))
else:print(max(j))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment