Question: def can_pay_with_two_coins(denoms: List[int], amount: int) -> bool: Return True if and only if it is possible to form amount, which is a number of cents,
def can_pay_with_two_coins(denoms: List[int], amount: int) -> bool:
"""Return True if and only if it is possible to form amount, which is a number of cents, using exactly two coins, which can be of any of the denominatins in denoms.
You can repeat coins (e.g., use two 10 cent coins to make 20).
>>> can_pay_with_two_coins([1, 5, 10, 25], 35)
True
>>> can_pay_with_two_coins([1, 5, 10, 25], 20)
True
"""
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
