D Block, United College of Engineering and Research, Naini, Allahabad. 



Daily Practice Problems

Your Today's Daily Dose...

Your Daily Dose #11

Once there were five pirates, each of them equally rational, intelligent and greedy. The pirates can be numbered as P1, P2, P3, P4 and P5 such that P5 has 1 years of service experience, P4 has 2 years of experience, P3, P2 and P1 has 3, 4 and 5 years of experience respectively.

One day they find a chest of 100 gold coins and they decided to divide it among themselves. Everyone being equally greedy wanted maximum profit, so they decided for the following solution:

  1. Each pirate will get a chance to propose a distribution rule, and then a poll will be conducted where all the pirates will vote on the proposal.

  2. If the proposal get 50 % or more votes then the proposal will be accepted and the distribution will take place, else the pirate will be killed and the other pirate will get a chance to propose a distribution rule, so on and so forth.

  3. The senior most pirate gets the first chance to propose the rule.

Given that all the pirates are greedy as well as rational, and you being the senior most pirate, what will be the proposal of distribution so that you get maximum profit and you are not killed as well.

#CodingInterviewProblems #TrickyAlgorithmsProblems #InterviewProgrammingProblems #GoogleInterviewProblems #InterviewProblems #CodingProblems #DailyPracticeProblem #DailyCodingProblems