Algorithm · Oracle · Medium
You are given an integer array ratings of length n, where each entry is the score of a film. A score can be positive, negative, or zero. For each film, you can either collect its score or skip it. Return the greatest possible total score subject to this restriction: you cannot skip two neighboring films. In other words, every adjacent pair of films must contain at least one film whose score you collect. For a single film, skipping is allowed, so the result may be 0. For an…
Checking your access…