Tap here to switch tabs
Problem
Submissions

Problem: Account Balance After Rounded Purchase

med
30 min
Try to solve the Account Balance After Rounded Purchase problem.

Statement

You start with an initial account balance of 100100.

You are given an integer purchaseAmount representing the cost of an item you want to buy.

When making the purchase, the amount charged is rounded to the nearest multiple of 1010. If purchaseAmount is equidistant between two multiples of 1010, it is rounded up to the greater multiple of 1010.

Return an integer representing your remaining account balance after paying the rounded amount.

Constraints:

  • 0≤0 \leq purchaseAmount ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Account Balance After Rounded Purchase

med
30 min
Try to solve the Account Balance After Rounded Purchase problem.

Statement

You start with an initial account balance of 100100.

You are given an integer purchaseAmount representing the cost of an item you want to buy.

When making the purchase, the amount charged is rounded to the nearest multiple of 1010. If purchaseAmount is equidistant between two multiples of 1010, it is rounded up to the greater multiple of 1010.

Return an integer representing your remaining account balance after paying the rounded amount.

Constraints:

  • 0≤0 \leq purchaseAmount ≤100\leq 100