You are viewing a single comment's thread. Return to all comments →
C#
public static int pageCount(int n, int p) { if (n % 2 == 1) n--; int l2R = 0, r2L = 0; for (int i = 1; i < p; i += 2) l2R++; for (int i = n; i > p; i -= 2) r2L++; return Math.Min(l2R, r2L); }
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 →
C#