I got TLE for this question can anyone help me

Please Look into it

Bro share question link

1 Like

Your time comp is O(t * d). So, it gave TLE. Try to optimize it.


Try to solve it in o(logD) - excluding the complexity due to test case loop.
Try to identify the pattern b/w no. of likes on first day, second day, third day,and…so on.
Identify the series…
(Well i gave you a hint)

Yes Please

I already gave you the hint.
Hint - Identify the series.
Its a formula based question and can be solved in O(logD).