You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an array of movie objects (found in the movieData.js file), write a function that will determine which actor made the most money from their movies.
7
+
Each actor in a movie receives an equal percent of the box office earnings.
8
+
For example, if BoxOffice was $100 and there were 3 actors, each actor would get $33.33.
9
+
The function should return the actor’s name and their earnings as a string.
10
+
m = #movies
11
+
a = #actors
12
+
Time: O(m*a^floor(a,m))
13
+
Space: O(a) - Each actor gets a spot in the mapping with a constant size value
Plot: "As a new threat to the galaxy rises, Rey, a desert scavenger, and Finn, an ex-stormtrooper, must join Han Solo and Chewbacca to search for the one hope of restoring peace.",
Plot: "After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda, while his friends are pursued across the galaxy by Darth Vader and bounty hunter Boba Fett.",
Plot: "After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star. Meanwhile, Luke struggles to help Darth Vader back from the dark side without falling into the Emperor's tr",
Plot: 'The story of Mark Felt, who under the name "Deep Throat" helped journalists Bob Woodward and Carl Bernstein uncover the Watergate scandal in 1972.',
0 commit comments