-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (22 loc) · 955 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const movieListOne = require("./movieData");
// Make a map of actors to a amount they made
/**
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.
Each actor in a movie receives an equal percent of the box office earnings.
For example, if BoxOffice was $100 and there were 3 actors, each actor would get $33.33.
The function should return the actor’s name and their earnings as a string.
m = #movies
a = #actors
Time: O(m*a^floor(a,m))
Space: O(a) - Each actor gets a spot in the mapping with a constant size value
*/
function actorEarning(movies) {
}
console.log(actorEarning(movieListOne));
/**
* @question Write a function that returns a list of the movies box office values.
* What's the space and time complexity of your implementation?
* */
function moviesBoxOffice(selectedMovies) {
}
console.log(moviesBoxOffice(movieListOne));