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