Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribedimage text in transcribedPython 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

Define the goals of persuasive speaking

Answered: 1 week ago