Question: kindly reply fast F Single File Programming Question Marks : 20 Negative Marks : 0 Michael is celebrating his 10th birthday and he wished to

F Single File Programming Question Marks : 20 Negative Marks : 0 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 denoting n. Assume that the maximum value for nas 50 Second line will contain n space separated integers where it integer corresponds to the day cihas given in the problem, Output format Print a single line corresponding to the maximum number of friendships Michael can save Sample testcases Input 1 Output Output format Print a single line corresponding to the maximum number of friendships Micha can save. Sample testcases Input 1 Output 1 2 2 32 Input 2 Output 2 10 8 4 2 3 5 8 1 6 5 4 9 Code Size : 1024 kb Note: The program will not be evaluated if 'Submit Code is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
