There is no Spoon - Episode 1 puzzle discussion

I think I must be missing something with the input, my code passes all the test cases on my local machine but fails on the site. Can anyone help me?

As I understand it I get the width and height as an integer, then a string with all of the rows from top to bottom, so a grid like this:

00
0.

should have input like this:
2
2
00
0.

and that’s how I modeled the tests.

But I fail the horizontal case which looks like this:

000

on the site, but I pass it on my machine with the inputs
3
1
000

I tried printing out the third input as I get it and I get 0.0.0

Am I just misunderstanding what the inputs are supposed to look like?

I’ve put my code here, apologies for it being a bit messy, I only started learning python yesterday:
https://pastebin.com/207r2Nys