Doubt

Revision en1, by pj_2103, 2022-05-19 16:01:34

Their are n number of children each of which have a[i] number of toffees. You have k extra number of toffees, you have to distribute less than or equal to k no of toffees such that maximum number of children have equal number of toffees. You have to find out the maximum number of children that will have equal number of toffees after the distribution of the toffees.

Constraints : Time complexity less than or equal to O(n*log(n)).

Tags arrays, binary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English pj_2103 2022-05-19 16:01:34 446 Initial revision (published)