51. N-Queens - Day 4/30 Leetcode June Challenge

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

This is the first time I've done this sum. I did plain recursion. Your idea of storing it in sets and the diagonal(r+c, r-c) is actually great. I never knew you could do the diagonals in such a way. Thanks for such a great video.

VasheshJ
Автор

Already had done this problem once or twice before but this time the thing I am doing differently is I go and look at the other solutions. Didn't even think about this idea of checking diagonals in this manner. You live and you learn.

ash_j
Автор

I have created a safe function to check wheather the next position is safe or not but what you have done is called branch and bound right??

Sandeep-zddq
Автор

This is a challenging question for me. Do you think this is a difficult question?

kyuan