You are viewing a single comment's thread. Return to all comments →
My solution in Java 8:
public static int pageCount(int n, int p) { // Write your code here return Math.min(p / 2, (p % 2 == 0) ? (n - p) / 2 : (n - p + 1) / 2); }
Seems like cookies are disabled on this browser, please enable them to open this website
Drawing Book
You are viewing a single comment's thread. Return to all comments →
My solution in Java 8: