Coding a chess problem! - EASY!

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: Coders by Yutish
286
9

Check if a Rook can reach the given destination in a single move

Subscribe to my channel ---    / @codersbyyutish3249  

Link to Ultimate Leetcode Challenge Playlist ---    • Ultimate Leetcode Challenge  

Also checkout my playlist on Coding Interview Problems ---   • Coding Interview Problems for Beginners  

-------------------------------------------------------------------------------------------------------------------

Problem Statement - Given integers current row and current column, representing the current position of a Rook on an 8 × 8 chessboard and two more integers destination row and destination column which represents the position to be reached by a Rook. The task is to check if it is possible or not for a Rook to reach the given destination in a single move from its current position. If found to be true, print “POSSIBLE”. Otherwise, print “NOT POSSIBLE”.

Example 1:

Input: current_row=8, current_col=8, destination_row=8, destination_col=4
Output: POSSIBLE

Example 2:

Input: current_row=3, current_col=2, destination_row=2, destination_col=4
Output: NOT POSSIBLE

#shorts​ #timeenthusiast #internationalchessday #geeksforgeeks


Auf dieser Seite können Sie das Online-Video Coding a chess problem! - EASY! mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coders by Yutish 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 286 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!