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.
publicstaticintworkbook(intn,intk,List<int>arr){intspecial=0;arr.Insert(0,0);intpage=0;intproblemsPerPage;for(inti=1;i<arr.Count;i++){Console.Write("\n**Chapter: "+i+"**");page++;// New Page for each ChapterConsole.Write("\nPage: "+page+"--> ");problemsPerPage=0;for(intj=1;j<=arr[i];j++){problemsPerPage++;if(j>k&&problemsPerPage>=k)// new page if k problems of one chapter at a page{page++;problemsPerPage=0;Console.Write("\nPage: "+page+"--> ");}if(page==j){special++;}Console.Write(j+" ");}}returnspecial++;}
Cookie support is required to access HackerRank
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 →
C# Solution