Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 614 Bytes

File metadata and controls

8 lines (5 loc) · 614 Bytes

Write a function two_as_one(a: int, b: int, c: int) -> bool that takes three integer inputs, a, b, and c. The function should return True if it is possible to add any two of the integers to get the third integer. Specifically, return True if any of the following conditions are met:

  • a + b == c
  • a + c == b
  • b + c == a

If none of these conditions are met, return False. For example, if the inputs are 2, 3, and 5, the output should be True because 2 + 3 == 5. If the inputs are 1, 2, and 4, the output should be False because no two of the integers add up to the third.