You are viewing a single comment's thread. Return to all comments →
A simple swift
func pageCount(n: Int, p: Int) -> Int { var p = p var n = n if p % 2 == 0 { p += 1 } if n % 2 == 0 { n += 1 } return n - p < p - 1 ? (n - p) / 2 : (p - 1) / 2 }
Drawing Book
You are viewing a single comment's thread. Return to all comments →
A simple swift