Question: Use Python : DUBER Fare Splitting: Suppose, you and your whole group just finished the CSE 2 2 0 class in BracU at 5 PM
Use Python : DUBER Fare Splitting:
Suppose, you and your whole group just finished the CSE class in BracU at
PM All of you are going to the Oppenheimer screening at Bashundhara. You
know that now the buses will be the most congested, so you decide to go by
DUBER. DUBER is a ride sharing app like UBER which can take at most two
passengers. Each DUBER car has the same amount of fare but all of you have
variable amounts of money with you. So now, you need to split up in groups of at
most so that the total amount of money of the group is equal to the fare of a
DUBER car so that you can pay easily. Now given an array of the amount of
money each of you have, write a program to find and print groups of maximum
that have a total amount of money exactly equal to the fare. If someone can not be
grouped in such a way, create an array with them and print the ungrouped
array.
Printing the group numbers is optional
Hint:
You do not need to create arrays of the eligible groups; print them
inside the function only.
Group Member serial or group serial does not matter
You need to create an array of ungrouped members and print.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
