Question: We have an NxM grid there are two animals one is 'Horse' and another is 'Bishop' which has different moving abilities. A 'Horse' can move

We have an NxM grid there are two animals one is 'Horse' and another is 'Bishop' which has different moving abilities. A 'Horse' can move 2.5 steps and a 'Bishop' can move only diagonal but not horizontally or vertically. Some grids are marked as inactive. Return 1 position where these animals can meet at any point. In the following image 0,3 & 2,0 are represented as an inactive grid where none of the animals can visit and 'Bishop' is at 3,2 position and possible direction are represented as arrow and 'Horse' is available at 6,6 and possible direction where horse can move are represented as arrow and circles. One of the possible point where the Bishop and Horse can meet is 4,5 as represented by yellow color. You need to use your own data structure, data types and test cases as per the requirement.


0 1 2 3 4 5 6 7 0 1 2 3 

0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

Step by Step Solution

3.48 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem you can use a Python function that takes the grid the positions of the horse a... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!