Design a Rectangular Jigsaw Puzzle
Model a playable rectangular jigsaw puzzle whose pieces can be placed, removed, and validated against borders and neighboring sides.
Design an object-oriented model for a rectangular jigsaw puzzle, including the Puzzle, Piece, and Side concepts. Sides may be flat, inward, or outward; border pieces and corner pieces are distinguished by their flat sides, and adjacent non-flat sides must be complementary.
For this exercise, assume one player receives exactly rows × columns uniquely identified pieces in their final orientation. The player may place an unplaced piece into an empty board position, remove a placed piece, and ask whether the puzzle is complete.
A placement is valid only when flat sides face the outer boundary, no flat side faces an interior neighbor, and every already-placed neighbor has a complementary touching side. An invalid operation must leave the puzzle unchanged.
You do not need to design an automatic solver, graphics, persistence, multiplayer behavior, or piece rotation in the base design.