Drawing Book

  • + 0 comments

    C#

        public static int pageCount(int n, int p)
        {
            var totalPages = n%2 == 0 ? n+1 : n;
            return Math.Min(p/2, ((totalPages - p)/2));
        }