We are building a Netflix clone where users can stream movies. Our service tracks and logs usage for each user. Each log contains the name of the movie, length of the movie (in minutes) and number of minutes of the movie watched by the user. Can you help with some data analysis?
Our code needs to return the Favorite movie: the name of the movie with the highest percentage of movie watched by the user. If a user watched 30mins out of 60mins for movie1 (50%) and 75min out of 100min of movie2 (75%), the movie with the highest percentage of movie watched by the user is movie2 (Assume that the values are such that there can never be a tie for this spot).