You are viewing a single comment's thread. Return to all comments →
JavaScript :
function pageCount(n, p) { // Write your code here let min = 1; let max = n % 2 == 0 ? n : n - 1 for(let i = 0; i <= n ; i++){ if(min >= p || max <= p){ return i } min += 2; max -= 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 →
JavaScript :