Problem

Return balance - cost if enough; else balance.

Examples

  • walletAfterBuy(50, 30) -> 20
  • walletAfterBuy(10, 30) -> 10
Compile and test (Ctrl+Enter)