We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
When splitting a bill, like Anna and Brian did, fairness means only paying for what you actually ate. If Anna skipped an item, that cost should be excluded before dividing the total. For example, if the meal included DQ burgers and fries but Anna passed on one burger, Brian should calculate her share based only on the items she consumed. If he overcharged her, the extra amount should be refunded. You can try this logic in real scenarios.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →
When splitting a bill, like Anna and Brian did, fairness means only paying for what you actually ate. If Anna skipped an item, that cost should be excluded before dividing the total. For example, if the meal included DQ burgers and fries but Anna passed on one burger, Brian should calculate her share based only on the items she consumed. If he overcharged her, the extra amount should be refunded. You can try this logic in real scenarios.