You are viewing a single comment's thread. Return to all comments →
Java Easy Solution:
public static int workbook(int n, int k, List<Integer> arr) { int pages = 0; int result = 0; for (int chapter : arr) { pages++; for (int i = 1; i <= chapter; i++) { if (pages == i) { result++; } if (i % k == 0 && i < chapter) { pages++; } } } return result; }
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 →
Java Easy Solution: