class Solution:
def accountBalanceAfterPurchase(self, purchaseAmount: int) -> int:
return 100 - (purchaseAmount + 5) // 10 * 10
2806. Account Balance After Rounded Purchase - LeetCode
ยท One min read
class Solution:
def accountBalanceAfterPurchase(self, purchaseAmount: int) -> int:
return 100 - (purchaseAmount + 5) // 10 * 10