Estee Advisors | Maximum Rating Sum | Nodes In a Tree | Nearest Neighboring City | 25th July 2023

Question · Posted Jul 2023

  Maximum Rating Sum Ryan is movie obsessed and has collected a list of movie quality ratings. He wants to watch the largest contiguous list of movies with the highest cumulative ratings possible. To do this, he must calculate the sum of all contiguous subarrays in order to determine the maximum possible subarray sum. For example, ratings are arr =[-1,3,4,-2,5,-7]. We can see that the highest value contiguous subarray runs from arr[1]-arr[4] and is 3+4+-2+5=10. Function Description Complete the function ...

The full answer & interview discussion are available to premium members.

Log in Create a free account