[Community Puzzle] Chess cavalry

https://www.codingame.com/training/hard/chess-cavalry

Send your feedback or ask for help here!

Every tests are ok
after submit, only test 4 ‘Protected king’ doesnt work.
Have you got other examples to understand pb and go through ?

Some variations based on test 4 :

8 8        8 8        8 8
....#...   ....#..B   ....#...
....##..   ....##..   ....##..
..E..#..   ..E..#..   ..E..#..
#...##..   #...##..   #...##..
.###...B   .###....   .###....
........   ........   ..B.....
........   ........   ........
........   ........   ........
=> 5       => 5       => 3
3 Likes

Thanks a lot !!

and it goes bad for both… grrr.
Fyi i am using a BFS chess knight moves as “neighbours”