Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java programming Michael is celebrating his 10th birthday and he wished to arrange a party to all his class mates. But there are n tough
Java programming
Michael is celebrating his 10th birthday and he wished to arrange a party to all his class mates. But there are n tough guys amongst his class who are weird. They thought that this is the best occasion for testing their friendship with him. They put up conditions before Michael that they will break the friendship unless he gives them a grand party on their chosen day. Formally, Ith friend will break his friendship if he does not receive a grand party on dith day. Michael is not a lavish spender and can give at most one grand party daily. Also, he wants to invite only one person in a party. So he just wonders what the maximum number of friendships he can save. Please help Michael in this difficult task. Input format First line will contain a single integer denohingn. Assume that the maximum value for n as 50 Second line will contain n space separated integers where ith integer corresponds to the day dithas given in the problem. Output format Print a single line corresponding to the maximum number of friendships Michael can saveStep 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