LeetCode 2596. Check Knight Tour Configuration - Interview Prep Ep 139

  Рет қаралды 656

Fisher Coder

Fisher Coder

Күн бұрын

Пікірлер: 6
@yt-user-99
@yt-user-99 Жыл бұрын
BFS definitely works here, but the more intuitive way for me to think about the problem was to visit each point in the grid in the order in which they are numbered (will require inital grid traversal and adding points to an extra array in the correct order). After that, you can just go point by point and check if moving from the previous point to the current point is a valid move ((diffX==1 AND diffY==2) OR (diffX==2 AND diffY==1)).
@FisherCoder
@FisherCoder Жыл бұрын
Cool, that's a nice approach as well, thanks for sharing!
@minaamir3056
@minaamir3056 Жыл бұрын
your explanation helped me to understand this problem because I participated in this contest and I read the description like 20 times and I didn't understand what is the problem at all, the description is very poor and naive, what I understood the knight moving in full chessboard like 8*8 board and the numbers are the positions he moved to and from like he will start from position 0 to 11 to 16, etc. using a chessboard here is nonrelevant at all, he could say that if you start on the [0,0] position and kept moving like a knight in a chessboard you will find the next position incremented by one not saying There is a knight on an n x n chessboard. I don't know if you get me or not but thanks anyway for the explanation, you know once I understood the problem from you I solved it in less than 30 minutes, but back in the contest I couldn't make any progress at all
@FisherCoder
@FisherCoder Жыл бұрын
I got you, and I'm glad that my video helped in this case, thanks for sharing! Cheers!
@HistoryHouse45
@HistoryHouse45 Жыл бұрын
please dont stop making videos
@FisherCoder
@FisherCoder Жыл бұрын
Will do! THANK YOU!
Knight's Tour - Numberphile
4:51
Numberphile
Рет қаралды 959 М.
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 35 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 1,7 МЛН
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 16 МЛН
Merge Sorted Array | Live Coding with Explanation | Leetcode - 88
4:50
Algorithms Made Easy
Рет қаралды 77 М.
PCTC Walkthrough | 2020-21 R2 Q11
11:44
Sourish Sharma
Рет қаралды 8
20 System Design Concepts Explained in 10 Minutes
11:41
NeetCode
Рет қаралды 1,1 МЛН
Java Collections Explained (with examples)
10:39
Visual Computer Science
Рет қаралды 96 М.
Starting Competitive Programming - Steps and Mistakes
9:55
William Lin (tmwilliamlin168)
Рет қаралды 1,4 МЛН
What is a semaphore? How do they work? (Example in C)
13:27
Jacob Sorber
Рет қаралды 310 М.
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49