Skip to content

Commit b97dd35

Browse files
authored
Difficulty: Easy
1 parent 0ddd84f commit b97dd35

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Cetvrta/Cetvrta.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'''
2+
https://open.kattis.com/problems/cetvrta
3+
'''
4+
def getPoint(known_x,Known_y):
5+
final_x = odd_one_out(known_x)
6+
final_y = odd_one_out(known_y) #bsaed on the fact that a rectangle will always have 2 points which have same x or y cordinates
7+
return final_x,final_y
8+
9+
def odd_one_out(a):
10+
occurance = [a.count(a[0]), a.count(a[1]), a.count(a[2])]
11+
odd = min(occurance)
12+
odd_one = occurance.index(odd)
13+
return (a[odd_one])
14+
15+
known_x = []
16+
known_y = []
17+
18+
for i in range(3):
19+
x,y = input().split()
20+
known_x.append(x)
21+
known_y.append(y)
22+
23+
ans = getPoint(known_x,known_y)
24+
25+
print(ans[0],ans[1])

0 commit comments

Comments
 (0)