You are viewing a single comment's thread. Return to all comments →
Here is my Python solution! I think it can probably be done much faster, but I was too lazy to try to create a more efficient solution.
def workbook(n, k, arr): special = 0 current = 1 sub = 0 for chapter in range(len(arr)): for problem in range(arr[chapter]): if sub == k: current += 1 sub = 0 if problem + 1 == current: special += 1 sub += 1 if sub != 0: current += 1 sub = 0 return special
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Lisa's Workbook
You are viewing a single comment's thread. Return to all comments →
Here is my Python solution! I think it can probably be done much faster, but I was too lazy to try to create a more efficient solution.