isSegmentViolated method

bool isSegmentViolated(
  1. Position position
)

Determines if a segment is violated by using a Set of Cell values If, while building this Set, a duplicate value is going to be added, then this segment is violated No violations are counted for empty cells (cells whose value is 0)

Implementation

bool isSegmentViolated(Position position) {
  return _doesCellCollectionHaveViolatedCells(getSegment(position));
}