Substitute list with set in polyomino