Company: Mathworks IIT Bhubaneswar
Difficulty: medium
Minimum Conference Complexity Problem Description Priya is attending a multi-day software conference made up of a fixed sequence of talks, and each talk carries a complexity rating. Priya has already decided the order in which she'll sit through the talks, and now needs to split that sequence across the conference's days. Every day must include at least one talk, and a day's own complexity is defined as the rating of the single most complex talk she attends that day. Priya wants to split the talks across the days so that the sum of each day's complexity, added up over the whole conference, is as small as possible. Given the talks' complexity ratings in the fixed order Priya will attend them, and the number of days the conference runs, what is the smallest total complexity achievable? Examples Example 1: Input: complexity = [1, 5, 3, 2, 4], days = 2 Output: 6 Explanation: Let's say there are n = 5 lectures, where complexity = [1, 5, 3, 2, 4], and the length of the conference is days = 2