Question: i want algarthm also can you please send code with in 20min its urgent please do fast i will give you like Description in the

i want algarthm also can you please send code with in 20min its urgent please do fast i will give you like
i want algarthm also can you please send code with in 20min

Description in the crossing-river problem, three animals of type X and three animals of type Y must cross a river using a boat which can carry at most two animals. Both types of animals are almost equally powerful and animals of type Y are merciless that if the number of animals of type X on a riverbank is outnumbered by the number of animals of type Y then animals of type Y would eat the animals of type X present on the bank Here, we focus on river bank animals, it XXXYYY is a string that represents the number of animals of type X and animals of type Y on the riverbank Write an algorithm and the subsequent Python code to check it the state is 'Safe' or 'Not Sate'. Assume that the 'Animal of type X is represented by letter X and Animal of type Y is represented by the lettery Input Format XXYY Output Format String valid Safe Test Cases Input XXYY String valid Test Cases Expected Output Safe Test Cases Input XXYYYY String valid Test Cases Expected Output Not Cafe

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!