Testcase not passing

Earlier in for loop when I wrote the condition i<=n/2 only 1 testcase was passing for me and when I changed it to i<n none of the testcases are passing even though i’m generating correct output for number 3.
Please check and tell my mistake.

hello @shazanahmed1

u need to print output after ur loop is complete .

ur updated code ->

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.