# BS-Editorial

Practice:https://www.codechef.com/problems/BS

Author: Chirag Chhabria

Tester: Nitin Pathak

Editorialist: Chirag Chhabria

Cakewalk

### Prerequisites

Concept of Profit and Loss

### Problem

Find the remaining balance of the user’s account if the withdrawal is less than the balance else print the balance

### Explanation

The solution only revolves around the condition if their is sufficient balance in the user’s account so as to withdraw the given amount after deducting the banking charges.
It can be solved with a complexity of O(1)

The testcases can be easily passed by checking two conditions including one where the withdrawal amount is a multiple of 5 or not and if the withdrawal amount plus the bank charges is less than the balance in the account.

O(1)

O(1)

### AUTHOR’S AND TESTER’S SOLUTIONS:

Author’s solution can be found http://campus.codechef.com/COVI18TS/viewsolution/19586608/.

Tester’s solution can be found http://campus.codechef.com/COVI18TS/viewsolution/19586765/.