We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static long taumBday(int b, int w, int bc, int wc, int z) {
// Write your code here
long minAmount;
long bc1=bc;
long wc1=wc;
if((bc1+z)<wc1){
minAmount=(b*bc1)+(w*(bc1+z));
return minAmount;
}else if((wc1+z)<bc1){
minAmount=(w*wc1)+(b*(wc1+z));
return minAmount;
}else{
minAmount = (b*bc1)+(w*wc1);
return minAmount;
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Taum and B'day
You are viewing a single comment's thread. Return to all comments →
Java