/// <summary> /// Searches W-Wing technique by region. /// </summary> /// <param name="result">The result.</param> /// <param name="grid">The grid.</param> /// <param name="digits">The digits.</param> /// <param name="region">The region.</param> /// <param name="c1">Cell 1.</param> /// <param name="c2">Cell 2.</param> /// <param name="intersection">The intersection.</param> private static void SearchWWingByRegions( IBag <TechniqueInfo> result, IReadOnlyGrid grid, int[] digits, int region, int c1, int c2, GridMap intersection) { for (int i = 0; i < 2; i++) { int digit = digits[i]; if (!grid.IsBilocationRegion(digit, region, out short mask)) { continue; } int pos1 = mask.FindFirstSet(), pos2 = mask.GetNextSet(pos1); int bridgeStart = RegionCells[region][pos1], bridgeEnd = RegionCells[region][pos2]; if (c1 == bridgeStart || c2 == bridgeStart || c1 == bridgeEnd || c2 == bridgeEnd) { continue; }