My code for wolf and sheep is getting WA. Help me.

1 Like

you cannot write NO for no of items>3. For example say you have 4 animals/items and only 1 pair 1,2 in which 1 eats 2 if present together in absence of boatman.

first you could take 2 or 1 to the other shore with boatman.(nobody eats anyone on the original shore)

then 3 and then 4 turnwise

and then finally 1 or 2 whichever you left in the first turn with boatman

Thanks a lot

1 Like