• + 0 comments

    Here is my Java8 Code:

        public static void bonAppetit(List<Integer> bill, int k, int b) {
        // Write your code here
            int total = 0;
            for(Integer e : bill)
            {
                total = total + e;
            }
            int anna = total - bill.get(k);
            anna = anna/2;
            
            if(b == anna)
                System.out.print("Bon Appetit");
            else 
                System.out.print(b-anna);
            
    
        }