You are viewing a single comment's thread. Return to all comments →
JAVA
public static int workbook(int n, int k, List arr)
{ int page = 1; int count = 0; for(int i=0;i<n;i++){ int noq = arr.get(i); int j =1; while(j<=noq){ int ques = j; int qcount = 1; while(qcount<=k){ if(ques==page){ count++; } ques++; if(ques>noq){ break; } qcount++; } page++; j+=k; } } return count; }
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
public static int workbook(int n, int k, List arr)