func validLine(hint []int, line []Square) bool {
	if len(hint) == 0 || len(line) == 0 {
		return false
	}
	hintNdx := 0
	curLength := 0
	curHint := &hint[hintNdx]
	afterYes := false
	for _, sq := range line {
		switch sq {
		case Unknown:
			return false
		case Yes:
			curLength++
			afterYes = true
			if curHint == nil {
				return false
			}
			if curLength == *curHint {
				curHint, hintNdx = nextHint(hint, hintNdx)
			}
		case No:
			if curHint != nil && curLength != *curHint && afterYes {
				return false
			}
			curLength = 0
			afterYes = false
		}
	}
	return true
}
// validLine checks a line to see if the layout matches the provided hints
validLine checks a line to see if the layout matches the provided hints
// validLine checks a line to see if the layout matches the provided hints
func validLine(hint []int, line []Square) bool {
	if len(hint) == 0 || len(line) == 0 {
		return false
	}
	hintNdx := 0
	curLength := 0
	curHint := &hint[hintNdx]
	afterYes := false
	for _, sq := range line {
		switch sq {
		case Unknown:
			return false
		case Yes:
			curLength++
			afterYes = true
			if curHint == nil {
				return false
			}
			if curLength == *curHint {
				curHint, hintNdx = nextHint(hint, hintNdx)
			}
		case No:
			if curHint != nil && curLength != *curHint && afterYes {
				return false
			}
			curLength = 0
			afterYes = false
		}
	}
	return true
}
func validLine ( hint [ ] int , line [ ] Square ) bool { if len ( hint ) == 0 || len ( line ) == 0 { return false } hintNdx := 0 curLength := 0 curHint := & hint [ hintNdx ] afterYes := false for _ , sq := range line { switch sq { case Unknown : return false case Yes : curLength ++ afterYes = true if curHint == nil { return false } if curLength == * curHint { curHint , hintNdx = nextHint ( hint , hintNdx ) } case No : if curHint != nil && curLength != * curHint && afterYes { return false } curLength = 0 afterYes = false } } return true }
validLine checks a line to see if the layout matches the provided hints
validLine checks a line to see if the layout matches the provided hints