0

Can anyone help me to solve this error

https://code.sololearn.com/c1W0Gr79dvGM/?ref=app

28th May 2021, 1:41 PM
Tina_Agrawal
Tina_Agrawal - avatar
2 odpowiedzi
+ 2
You call nQueen with x being 0 as the initial argument, x is being used in the first loop in issafe as the delimiter, but in nQueen you subtract 1 from x after each recursion which causes x to go negative and that causes the loop iterator's value to get very big. Probably you meant to do +1 instead?
28th May 2021, 1:59 PM
Dennis
Dennis - avatar
0
Thankyou so much I realised my mistake.
28th May 2021, 4:50 PM
Tina_Agrawal
Tina_Agrawal - avatar