Ad
  • Custom User Avatar

    Hi, Thanks for the comment. Yes, the named return value here is just for reducing the number of lines, and make the code enjoyable, since it s just 9 lines of code. I did enjoy writing it. Right now I am thinking about n-queens on 1000x1000 chess board to solve it under 10 seconds. let me know if you have a 10-second solution :)

  • Default User Avatar

    Yeah, as I recall that scenario threw me at first too. In my first attempt I wasn't doing the b < 0 check inside the loop, only ckecking for b == 0 at the end.