Skip to content

Instantly share code, notes, and snippets.

@lucas404x
Created May 30, 2019 21:49
Show Gist options
  • Save lucas404x/d3e8abe4327a217202e873da4120f4ad to your computer and use it in GitHub Desktop.
Save lucas404x/d3e8abe4327a217202e873da4120f4ad to your computer and use it in GitHub Desktop.
n = int(input())
n1 = int(input())
n2 = int(input())
n3 = n - (n1 + n2)
if n1 > n2 and n1 > n3:
print(n1)
elif n2 > n1 and n2 > n3:
print(n2)
else:
print(n3)
n = [0 for i in range(int(input()))]
repetem = []
for i in range(len(n)):
n[i] = int(input())
if len(n) == 1:
print(1)
else:
for i in range(len(n)):
if n.count(n[i]) > 1 and not n[i] in repetem:
repetem.append(n[i])
for number in repetem:
oneNumber = n.index(number)
if n[oneNumber] == n[oneNumber + 1] or n[oneNumber] == n[oneNumber - 1]:
repetem.remove(number)
print(len(repetem) * 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment