You are viewing a single comment's thread. Return to all comments →
Java
public static void bonAppetit(List<Integer> bill, int k, int b) { int actualPrice; int current=bill.get(0); for(int i=1; i<bill.size(); i++) { if(i==k) { bill.remove(k); } current+=bill.get(i); } actualPrice=current/2; if(actualPrice==b) { System.out.println("Bon Appetit"); } else { System.out.println(b-actualPrice+" "); } }
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 →
Java