In candy loves problem i am not getting o/p please correct my code
@kailash_01 please take a look at this segment of your code . Your a[1] =0 ,so this portion of your code is giving TLE
while(n>=i){
if(a[j]==1)
i++;
}
Your j starts from 1, so i never gets incremented and control doesn’t leave this loop.