Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python solution please Given the number of five-star and total reviews for each product a company sells, as well as the threshold percentage, what is
Python solution please
Given the number of five-star and total reviews for each product a company sells, as well as the threshold percentage, what is the minimum number of additional five-star reviews the company needs to become five star seller. public static int fiveStarReviews (List- here, [1,2] indicates => [1 (five star reviews) , 2 (total reviews)] . threshold = 77 Output: 3 Explanation : We need to get the seller reach the threshold with minimum number of additional five star reviews. 23 60.66 Output: 3 Explanation : We need to get the seller reach the threshold with minimum number of additional five star reviews. Before we add more five star reviews, the percentage for this seller is ((4/4) + (1/2) + (3/6))73 = 66.66% If we add a five star review to 2nd product, ((4/4) + (2/3) + (376))/3 = 72.22% If we add another five star review to 2nd product, ((4/4) + (3/4) + (376))/3 = 75% If we add a five star review to 3rd product, ((4/4) + (3/4) + (4/7))/3 - 77.38% At this point, 77% (threshold) is met. Therefore, answer is 3 (because that is the minimum five star reviews we need to add, to get the seller reach the threshold). Constraints: 1 int: 4. if name main ": 9 10 Python Run Tests Implementation Python JavaScript Java from typing import List def fiveStarSellers (productRatings: List[List[int]], ratings Threshold: int) -> int: # WRITE YOUR BRILLIANT CODE HERE if __nane _main__": ratings Threshold = int(input() RE 09 ENG 12:25 AM 27-Dec-20 89
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started