Question: Solve using java and java 8 keeping the time and space complexities in mind... kindly provide correct solution Objective : In this problem, you'll be

Solve using java and java 8 keeping the time and space complexities in mind...
kindly provide correct solution
Objective :
In this problem, you'll be given a list of daily stock prices, and you'll be asked t turn the three stocks with the highest average price.
Implement the method
getTopStocks(stocks, prices) which takes as input:
* an array of strings
stocks
, representing the considered stocks.
* an array of 2 dimensions (prices
, representing the stock prices (inner
lists) for each day (outer list).
Your getTopStocks
method should return an array containing the names of
three stocks with the highest average value. The array should be sorted by decreasing average value. You're guaranteed that each stock will have a unique average value.
method should return an array containing the names of the
three stocks with the highest average value. The array should be sorted by decreasing average value. You're guaranteed that each stock will have a unique average value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!