+ 1

Stack limit exceed error

when i entered 1 disk, i got 'stack limit exceed error'. i cant understand why? https://code.sololearn.com/WsjY2RPMWzYA/?ref=app

17th Apr 2017, 4:11 AM
Thang Nguyen
Thang Nguyen - avatar
3 ответов
+ 1
check function moveQueue. diskNum goes lower 0 put console.log(diskNum+ " "+ from +" "+to +" "+ middle) in the begin of this function
17th Apr 2017, 5:58 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
+ 1
When diskNum = 1, statement 'diskNum === 1' in the function moveQueue return false. And now I know why. :) === (strictly equal), that's the problem. Thank you, Yaroslav.
17th Apr 2017, 6:28 AM
Thang Nguyen
Thang Nguyen - avatar
0
no problem
17th Apr 2017, 6:29 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar