2806. Account Balance After Rounded Purchase

1
2
3
4
5
class Solution {
public int accountBalanceAfterPurchase(int purchaseAmount) {
return 100 - (purchaseAmount + 5) / 10 * 10;
}
}

References

2806. Account Balance After Rounded Purchase