-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathareEquallyStrong.cpp
30 lines (22 loc) · 1.23 KB
/
areEquallyStrong.cpp
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
28
29
30
/*
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.
Example
•For yourLeft = 10, yourRight = 15, friendsLeft = 15 and friendsRight = 10, the output should be
areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) = true;
•For yourLeft = 15, yourRight = 10, friendsLeft = 15 and friendsRight = 10, the output should be
areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) = true;
•For yourLeft = 15, yourRight = 10, friendsLeft = 15 and friendsRight = 9, the output should be
areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) = false.
*/
bool areEquallyStrong(int yourLeft, int yourRight, int friendsLeft, int friendsRight) {
if(yourLeft == friendsRight && yourRight == friendsLeft || yourLeft == friendsLeft && yourRight == friendsRight)
return true;
else
return false;
}
//
// Created by Muhamed Karajic on February 18, 2018.
// Copyright © 2018 Muhamed Karajic. All rights reserved.
//