Problem
Maximize Movie Ratings With Skip Limit
Learn this problemProblem statement
You are given an integer array ratings, where ratings[i] is the rating of the i-th movie.
You may choose to watch or skip each movie, but you cannot skip two or more movies consecutively.
Return the maximum possible sum of watched movie ratings while respecting the skip constraint.
Function
maximizeMovieRatings(ratings: int[]) → intExamples
Example 1
ratings = [-3,2,4,-1,-2,-5]return = 4Constraints
1 <= ratings.length-1000 <= ratings[i] <= 1000