code-https://ide.codingblocks.com/s/326666
I don’t know where am I going wrong. When I visit a cell I mark it 1 and the places which it blocks I mark -1.
Then this is done for every row. I also figured that because they are horses they can all stay on the same like so the number of ways to do that would be equal to the number of rows or horses so I add that to the total count.