Why am I getting TLE ?

Revision en2, by CandidFlakes, 2023-08-19 15:20:56

I am trying to solve this question.

I have made use of unordered map to store the frequency of each doll size and then I count the sets by subtracting the difference between the consecutive frequency, If we are considering element a then we look for the frequency of element a-1, if the frequency of element a-1 is less than frequency of element a, then we increase the count of set by frequency(a)-frequency(a-1). It seems to be working fine but I am getting TLE in test case 28. Here, is my submission.

Why am I getting TLE? Please suggest changes to remove this TLE error.

I will be thankful for any help!

Tags tle, time limit exceeded, time exceeded, unordered_map

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English CandidFlakes 2023-08-19 15:20:56 0 (published)
en1 English CandidFlakes 2023-08-19 15:20:17 753 Initial revision (saved to drafts)