Confusion in code

i have written a code but i think there is some mistake

@naaz you are using the condition while(i < l) i = n at that point because of the for loop that ran earlier, and l = 1. So this condition would never run and hence the whole program will not be executed.

how to code the error then

@naaz use appropriate values for those variables… Try to do a dry run once and try to figure out what should be their value.

please tell me how to clear this problem

hi @naaz you can refer to this code

got my mistake , i was using while loop in wrong way

@naaz glad you found your mistake :slight_smile: please mark your doubt as resolved if you havent already