-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel19.py
More file actions
27 lines (19 loc) · 946 Bytes
/
level19.py
File metadata and controls
27 lines (19 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Call two arms equally strong if the heaviest weights they each are able to lift are equal.
# Call two people equally strong if their strongest arms are equally strong (the strongest arm can be both the right and the left), and so are their weakest arms.
# Given your and your friend's arms' lifting capabilities find out if you two are equally strong.
def solution(yourLeft, yourRight, friendsLeft, friendsRight):
if (yourLeft+yourRight)==(friendsLeft+friendsRight) and any([
yourLeft==friendsLeft,
yourRight==friendsRight,
yourLeft==friendsRight,
yourRight==friendsLeft
]):
return True
return False
# alt solution
# def solution(yourLeft, yourRight, friendsLeft, friendsRight):
# if yourLeft == friendsLeft and yourRight == friendsRight:
# return True
# elif yourLeft == friendsRight and yourRight == friendsLeft:
# return True
# return False