You are viewing a single comment's thread. Return to all comments →
java 2 liner the delta for kelly has to be > 0, or she will never surpass the difference / delta are the required days adding 1 to difference to account for a day 0 case
java 2 liner
the delta for kelly has to be > 0, or she will never surpass
the difference / delta are the required days
adding 1 to difference to account for a day 0 case
public static int minNum(int samDaily, int kellyDaily, int difference) { int kellyDelta = kellyDaily - samDaily; return kellyDelta <= 0 ? -1 : (int) Math.ceil((double) (difference + 1) / kellyDelta); }
Seems like cookies are disabled on this browser, please enable them to open this website
Coding Friends
You are viewing a single comment's thread. Return to all comments →