Help with optimization

Revision en1, by PimpedButterfly, 2022-12-09 16:33:31

The following code despite being asymptotically fine, is still giving TLE on the 31st test case. I have tried everything, but I am not able to optimize this code further. I need inputs from more coders, any help would be appreciated. The problem link is this and my attempt is this (Incase the code is not readable, inform me I will format and edit in the code)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English PimpedButterfly 2022-12-09 16:33:31 491 Initial revision (published)