PROJECT EULER · #0339
Peredur Fab Efrawg
"And he came towards a valley, through which ran a river; and the borders of the valley were wooded, and on each side of the river were level meadows. And on one side of the river he saw a flock of white sheep, and on the other a flock of black sheep. And whenever one of the white sheep bleated, one of the black sheep would cross over and become white; and when one of the black sheep bleated, one of the white sheep would cross over and become black."
(Taken from The Mabinogion (1877): Peredur son of Efrawg, p108-109)
Initially each flock consists of
You are given that
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.