Company: Zscalar_2march
Difficulty: medium
Movie Ratings Problem Description Alex loves movies and keeps track of their ratings, which can be either positive or negative integers. Alex is preparing for a film festival and wants to choose a subsequence of movies that meets the following criteria: The total sum of their ratings is maximized. Also must follow the list in order. You can skip more than one movie but not consecutively. For instance, if ratings = [1, 3, -2, 4], you can include either the first and fourth numbers or both the first and third numbers to achieve a maximal rating sum of 4. Function Description Complete the function maxMovieRatings in the editor with the following parameter(s): ratings : an integer array of movie ratings Returns int : the maximum possible rating sum for a subsequence of movies Examples Example 1: Input: ratings = [2, 4, -2, 4] Output: 4 Explanation: The maximal choices are [2, 4, -2] for a sum of 4. Example 2: Input: ratings = [-1, -2, -3, -4, -5] Output: -1 Explanation: Alex picks the item