Company: Mathworks IIT Bhubaneswar
Difficulty: medium
Efficient Study Problem Description An e-book provider offers a variety of programming articles, each with a distinct intellectual value. Readers earn points equal to an article's intellectual value for each article read twice. Given a list of articles with their page lengths, intellectual value coefficients, and a daily page limit, find the maximum achievable intellectual value in one day. Examples Example 1: Input: iv = [2, 4, 4, 5], articles = [2, 2, 3, 4], p = 15 Output: 10 Explanation: There are n = 4 articles with lengths [2, 2, 3, 4] and intellectual values [2, 4, 4, 5]. The maximum pages that can be read per day is p = 15. Two optimal approaches are: reading the first, second, and third articles (2 × 2 + 2 × 2 + 2 × 3 = 14 pages) or reading the third and fourth articles (2 × 3 + 2 × 4 = 14 pages). The maximum total intellectual value is iv[0] + iv[1] + iv[2] = 2 + 4 + 4 = 10. Function Description Complete the function maximumLearning in the editor with the following parameter(s