본문 바로가기
python

[code signal / 코드시그널] are Equally Strong

by 래끼 2022. 5. 30.
728x90
반응형

 

✨ Description

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

 

✨ My Submission

def solution(yourLeft, yourRight, friendsLeft, friendsRight):
    return {yourLeft,yourRight} == {friendsLeft,friendsRight}

 

 

 

 

 

728x90
반응형

댓글