pj_2103's blog

By pj_2103, history, 23 months ago, In English

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)).

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it