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