diff --git a/new.txt b/new.txt new file mode 100644 index 0000000..c194fe4 --- /dev/null +++ b/new.txt @@ -0,0 +1,23 @@ +if p%2==0 and p==n-1: + return 0 + + + if p==1 or p==n: + return 0 + + pageList = list(range(0,n+1)) + print(pageList) + + fIndex = pageList.index(p) + print(int(fIndex/2)) + + fPages = int(fIndex/2) + pageList.reverse() + print(pageList) + rIndex = pageList.index(p) + #print(rIndex) + rPages = int(rIndex/2) + print(int(rIndex/2)) + return min(fPages,rPages) + #pageDiff = n-p + #pageHalf = int(n/2) \ No newline at end of file