You walk into a room and see a bed. On the bed, there are two dogs, five cats, a giraffe, six cows, and a goose. There are also three doves flying above the bed. How many legs are on the floor?
You have to fill the below given grid in a manner that every row and column contains the digits 1 to 6. Also, make sure that the squares that are connected with each other must contains the same digit.