Question: 2 Write a function: def solution ( B ) which, given a square board of N N size describing Aladdin's and Jafar's pawns, retums the
Write a function:
def solutionB
which, given a square board of size describing Aladdin's and Jafar's pawns, retums the maximum number of pawns Jafar can beat in one turn. If none of Aladdin's pawns can be beaten, the function should retum
Jafar's pawn is described by the character, Aladdin's pawns by characters and empty fields by : dots The board is described from top to bottom and from left to right.
For example, given:
dotsdots
dots..
dots
dots.
dots
the function should retum Jafar can beat Aladdin's pawn in the upright direction and then another one in the upleft direction
Given:
dots.
dots.
dots
dots..
dots.
the fiuntion ohneAd rotiun a
Assume that:
N is an imeger writin the range
all swings in are made only of the following characters : andco :
the bourd is square:
the bourd contzins eractly one pawn cowned by Jafar.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
