Company: Trilogy_10july
Difficulty: medium
Book Cover Problem Problem Description You run a used-book stall with A books lined up in a row, where the i th book sits just to the left of the (i + 1) th book for 1 <= i < A - 1 . Each book's thickness is given by an array B[] , where B[i] is the thickness of the i th book, and no two books share a thickness. To dress up your stall, you can wrap a protective cover around some of the books. Covers are costly, so you want to use as few as possible while meeting all of the following: At least one book must be covered. Whenever the i th book is covered, every book thicker than it must be covered too. Some contiguous run of books, at least C books long, must contain strictly more covered books than uncovered ones. Determine the fewest books you need to cover in order to satisfy all of the above. The function signature is: int solution(int a, vector<int> b, int c) Where: a (integer) is the number of books. b ( vector<int> ) is an array representing the thickness of the b