You are viewing a single comment's thread. Return to all comments →
rust in O(1) solution
fn page_count(n: i32, p: i32) -> i32 { (p / 2).min((n - p + (n + 1) % 2) / 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 →
rust in O(1) solution