알고리즘(CF)2017. 6. 18. 10:42

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 = 10yourRight = 15friendsLeft = 15 and friendsRight = 10, the output should be
    areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) = true;
  • For yourLeft = 15yourRight = 10friendsLeft = 15 and friendsRight = 10, the output should be
    areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) = true;
  • For yourLeft = 15yourRight = 10friendsLeft = 15 and friendsRight = 9, the output should be
    areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) = false.





Code

function areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight) {

  

}


'알고리즘(CF)' 카테고리의 다른 글

21. isIPv4Address  (1) 2017.06.19
20. arrayMaximalAdjacentDifference  (1) 2017.06.18
18. palindromeRearranging  (1) 2017.06.17
17. arrayChange  (1) 2017.06.17
16. areSimilar  (1) 2017.06.17
Posted by EL2A