Skip to content

aman1711/Machine_coding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Machine_coding

Problem statement 1:

A cab company has the list of cab rides after it gets completed. After the journey both cab driver and ride taker provide rating to each other. Rating can be from 1 to 5 where 5 is the best rating and 1 being the worst. Given a Rider taker name, find the eligible cab drivers for him based on the historical data that is being given to you. The criteria are given below to choose the eligible cab drivers –

  1. Average rating of Cab driver should be greater than average rating of ride taker (Choose with the highest rating).
  2. If no cab driver is found, then consider the best of all of them.
  3. If any cab driver has provided 1 rating to a ride taker or vice versa then they are not allowed to do a ride together.
.

Ex: Input
Ride data is given {Ride Taker Name, Rating given to Ride Taker, Driver Name, Rating given to driver}
Ride 1 – {Ram, 3, Bheem, 5}
Ride 2 – {Laxman, 5, Nakul, 2}
Ride 3 – {Ram, 4, Sahadev, 2}
Ride 4 – {Bharat, 3, Bheem, 5}
Ride 5 – {Ram, 3, Bheem, 1}
Ride 6 – {Laxman, 5, Sahadev, 3}
Ride 7 – {Bharat, 5, Nakul, 5}
Find eligible drivers for:
Eg:
1. Ram
2. Laxman
Output:
1. Nakul
2. Bheem

Problem statement 2:

You are given an input integer N which is the number of teams in a cricket tournament. For each team, first, you will be given with Team Name and then K, which is the number of players in that team. Now next K lines contain playerNames. The team will then be provided with total points

Your job is to print the name of first-team on the leaderboard.

Ex: Input 3
INDIA 4
VIRAT
DHONI
SEHWAG
BHAJJI
1
AUSTRALIA 3
PONTING
SYMONDS
SMITH
3
ENGLAND 2
MORGAN
BUTLER
2

Output: AUSTRALIA

About

Java Implementation of two question based on oops concept.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages