You are viewing a single comment's thread. Return to all comments →
Kotlin:
var actualAmount=0 bill.forEachIndexed { i,it -> if(i!=k) actualAmount+=it } val actualSplitAmount=actualAmount/2 if(b==actualSplitAmount){ println("Bon Appetit") }else{ val overchargedAmount=b-actualSplitAmount println(overchargedAmount) }
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 →
Kotlin: