Here's the problem and the diagram that goes with it

Fill in each empty space of the grid in the image below with a number from 1 to 8 so that every row & column contains each of these digits only once. Some diagonally adjacent spaces have been joined together. For these pairs of joined spaces the same number must be written in both. 

Diagram:

[![enter image description here][1]][1]

A substitute teacher provided us with this puzzle. Can you please provide an explanation of how to get to the answer?


  [1]: https://i.sstatic.net/Fsbn2.jpg