You are viewing a single comment's thread. Return to all comments →
O(n) where n number of pages
def workbook(n, k, arr): m=1 n=1 o=0 acc=0 while (o != len(arr)): le = min(m+k-1, arr[o]) if (m <= n and n <= le): acc+=1 m = le + 1 if (m > arr[o]): o+=1 m=1 n+=1 return acc
Seems like cookies are disabled on this browser, please enable them to open this website
Lisa's Workbook
You are viewing a single comment's thread. Return to all comments →
O(n) where n number of pages