+ 3
Why is my code not working?
https://code.sololearn.com/c8RWw6GAp4R3/?ref=app EDIT: I have placed the if (x-i==1) inside the loop but the code is still not working.
5 Answers
+ 4
Thank you all for the help : )
(I hope I posted this at the right moment)
+ 3
if (x-i==1) {return true; }
This if statement is outside of the for loop and doesn't have access to the variable i.
+ 3
Sergey Semendyaev ChaoticDawg
I have placed the if (x-i==1) inside the loop but the code is still not working.
+ 2
Exactly. Maybe it's just me, but I've never seen anybody using figure braces like you.
And maybe it's the reason you've stuck.
+ 1
as I see, it works.