Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Mapple company has just released a latest model of MPhoneXl.There is a queue outside one of the stores and the store manager has decided for
Mapple company has just released a latest model of MPhoneXl.There is a queue outside one of the stores and the store manager has decided for giveaways to attract more customers. The giveaways will be given to the people who are in the queue.The store manager has asked the customers in the queue to pick a positive number of their choice. Manager finds the floor average of the numbers picked by them and prepares a shortlist of those who have chosen floor average as their number. He then identifies the maximum distance between the shortlisted. The maximum distance is the output.Given an array of N positive integers, representing the numbers chosen by N customers in the queue. Write a program to find out the maximum distance between the winners. Print if at least two winners cannot be identified.Input Format: Input string will contain all the positive integers separated by comma.Output Format: Only one positive integer has to be printed or in case at least two winners cannot be identifiedSample input: Sample Output: Explanation: is the floor average.We have inputs matching number and the maximum distance between such inputs is Sample input: Sample output: Explanation: is the floor average.Since no winner can be identified, should be printed as the output.Use Python version to code
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