Help in problem

Revision en3, by __Tanzeel__, 2021-12-22 08:22:13

Yesterday there was a online test of some website (GeeksforGeeks) where I encountered the below problem, I was not successful in getting AC for the problem because of TLE issue, it will be very helpful if someone can share the approach or give hints to solve the problem ,below I am attaching the problem statement. My time complexity of the solution was O(N.x) where 'x' is the frequency of maximum element of the given array.    Any help will be appreciated.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English __Tanzeel__ 2021-12-22 08:22:13 3 Tiny change: ' very help if someon' -> ' very helpful if someon'
en2 English __Tanzeel__ 2021-12-22 08:20:24 5 Tiny change: 'Any help would be apprec' -> 'Any help will be apprec'
en1 English __Tanzeel__ 2021-12-22 08:14:11 692 Initial revision (published)