Marks :100
: 19 | : 0
Bob has an array of integers arr of size n and an integer x. Alice asks him to perform a few operations on the array. In one operation Bob can choose any index and increment the element at that index by 1. He can perform at most x operations.
Alice is curious and wants to know what could be the maximum occurrence of any element of the array after performing at most x such operation.
Alex is too lazy to perform the task, can you help him find the answer so that he could impress Alice?
The first line contains integer n and X ($$$ 0 \le n \le x \le 10^5$$$).
The second line contains n spaces separated by integers ($$$0 \le a_i \le 10^5$$$)
Print the maximum occurence of the element in the array
4 5 1 4 8 13
2
5 10 0 8 4 2 10
3
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.