on children day, a teacher wants to distribute candies to all her students she has an N candies and each candy has a special value she wants all candies to have the same special value so she decided to reduce the special values of some candies however the special values of all the candies cannot be reduced
Answers
Answered by
6
Yes The value which ebetered special character cannot be taken multipple times as in primary key duplicate values are not allowed!
Answered by
0
Answer:
Input 1: Total Number of Candies- N
Input 2: Candies having the same special value-K
Input 3: The array represents the special values of candy
Output: Return the maximum value that the teacher can achieve.
Explanation:
Example Input 1: 5
Input 2: 4
Input 3: (25, 21, 27)
Output : 27
So, the teacher can reduce the special value of the first candy to 27, and therefore, at least two candies will get the special value of 27.
#SPJ3
Similar questions