This is a standard Slitherlink puzzle.

Hmm, uniqueness logic with 2 in the corner is a pain as a constructor, isn’t it?