Exemple #1
0
        private void Solve_Part_NotConnectedbutOnlyBlockSetIsConnected()
        {
            if (_currentColor.IsConnected)
            {
                return;
            }
            var possibleSpots = _oppositeItems.Where(o => o.Colors.Any(cc => cc.MyColor == _currentColor.MyColor && cc.Count > 0)).ToList();
            var idxList       = new IndexList(possibleSpots.Select(c => c.Index));

            if (idxList.Count == _currentColor.Count + 1 && idxList.IsConnected)
            {
                FillCells(new List <int> {
                    idxList.Min(), idxList.Max()
                });
            }
        }