2806. Account Balance After Rounded Purchase ¶ Time: $O(1)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: int accountBalanceAfterPurchase(int purchaseAmount) { return 100 - ((purchaseAmount + 5) / 10) * 10; } }; 1 2 3 4 5class Solution { public int accountBalanceAfterPurchase(int purchaseAmount) { return 100 - ((purchaseAmount + 5) / 10) * 10; } } 1 2 3class Solution: def accountBalanceAfterPurchase(self, purchaseAmount: int) -> int: return 100 - ((purchaseAmount + 5) // 10) * 10