We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defpageCount(n,p):nbFlipFront=0pageFront=1pageBack=nnbFlipBack=0whilepageFront!=p+1:print(f"actual page from front:{pageFront}")ifpageFront%2==0:nbFlipFront+=1pageFront+=1whilepageBack!=p:print(f"actual page from back:{pageBack}")ifpageBack%2==0:nbFlipBack+=1pageBack-=1
Cookie support is required to access HackerRank
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 →
in python I use 2 loop