Thank you for clearing my doubt. I have changed my code as you suggested. But, it is still showing TLE error.
Code Link: https://ide.codingblocks.com/s/483519
Thank you for clearing my doubt. I have changed my code as you suggested. But, it is still showing TLE error.
Code Link: https://ide.codingblocks.com/s/483519
this is because you forgot to decrease t
and stuck in infinite loop
while(t > 0)
{
cin>>N;
for(int i = 0; i < N; i++)
cin>>A[i];
cout<<max_bitcoin_length(N)<<endl;
t--; // it is important otherwise loop never finish
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.