# Colombian Sudoku

Fill each empty cell of the board on the left with a digit between 1 and 6. Each column and row must contain all digits.

The dots outside the board on the right indicate how many cells in the corresponding column or row of that board contain precisely the same digit as is to be found in the same cell on the board on the left.

2 3 5 1 4 6
5 2 1 3 6 4
1 6 2 4 3 5
4 1 3 6 5 2
6 5 4 2 1 3
3 4 6 5 2 1

Logical steps:

Let $$(a, b)$$ denote the $$a$$-th row and $$b$$-th column. I filled in the cells in the following order:

(1,2) = 3: on row 1, the two 1's and two 4's can match at most 2, and the 6 already doesn't match. So the 3 is a match.
(1, 5) = 4, (3, 5) = 3, (5, 5) = 1: on column 5, there only remains these three possible matches.
(4, 5) = 5, (6, 5) = 2: only possibility for (4, 5).
(2, 2) = 2, (2, 5) = 5: since the only match on row 3 is (3, 5), we know (3, 2) is not a match. Thus (2, 2) and (2, 5) must be matches.
(2, 1) = 5, (2, 4) = 3: Now (2, 6) is not a match, these two are matches.
(5, 6) = 3: it's the only possible remaining match on row 5.
(1, 4) = 1: it's the only possible remaining match on row 1.

At this point we determined all the matches. After that it's easy (similar to a normal Sudoku).

I use chess notation (columns a to f from left to right and row 1 to 6 from bottom to top). In the board, digits with < > are givens, digits with ** are derived digits, and cells with two or more digits display all possible digits in that cell (taking the constraints into account). The board is given only to help follow the solution path.

In row 6, number 6 will not match c6=5 and we need 3 matches in that row, so 1,3,4 must match and we can place 3,4: b6=3, e6=4.

.           .
.       .   .
.   .       .   .   .
.-----------------------.     .-----------------------.
|   |*3*|<5>|   |*4*|   | 6   | 4 | 3 | 6 | 1 | 4 | 1 | 6 . . .
|---+---+---+---+---+---|     |---+---+---+---+---+---|
|   |   |   |   |<6>|   | 5   | 5 | 2 | 5 | 3 | 5 | 2 | 5 . . .
|---+---+---+---+---+---|     |---+---+---+---+---+---|
|   |   |   |   |   |   | 4   | 6 | 1 | 4 | 2 | 3 | 4 | 4 .
|---+---+---+---+---+---|     |---+---+---+---+---+---|
|   |<1>|   |   |   |<2>| 3   | 2 | 4 | 1 | 4 | 2 | 5 | 3
|---+---+---+---+---+---|     |---+---+---+---+---+---|
|   |   |   |   |   |   | 2   | 3 | 5 | 2 | 5 | 1 | 3 | 2 . . .
|---+---+---+---+---+---|     |---+---+---+---+---+---|
|   |   |   |   |   |   | 1   | 1 | 6 | 3 | 6 | 6 | 6 | 1
'-----------------------'     '-----------------------'
a   b   c   d   e   f         a   b   c   d   e   f

In row 2, we need again 3 matches with 2,3,5, and due to the givens, there is only one place for 5 (a5=5), for 2 (b5=2) and for 3 (d5=3).

In column e, we need three matches and so far got only one (and 2,5,6 will not match due to the givens), so 1,3 must match: e2=1, e4=3. The only possible digit at e3 is 5. To complete the column e: e1=2 Now we observe that column 1 already has a match (a5=5), and the only spot for a 1 at that column is a4=1.

(this is so because at row 6, 1 must be at d6 or f6, a5=5, a3 can't be 1 due to b3=1, a2 can't be 1 due to e2=1, a1 can't be 1 because that would give a second match at column 1)

Next, at row 2, we must have f2=3.

(in that row, a2 can't be 3 because that would give a second match at column 1 and if c2=3, then digits 2 and 3 would not match, making impossible to get the needed 2 additional matches for row 2)

This last placement fulfilled the constraint for column f, so we must have d6=1, and f6=6, a6=2. Then, f4=5 (it cannot be 4 to avoid a second match at row 4).

.           .
.       .   .
.   .       .   .   .
.--------------------------.     .-----------------------.
|*2*|*3*|<5> |*1* |*4*|*6* | 6   | 4 | 3 | 6 | 1 | 4 | 1 | 6 . . .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|*5*|*2*| 14 |*3* |<6>|14  | 5   | 5 | 2 | 5 | 3 | 5 | 2 | 5 . . .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|*1*|46 | 26 | 46 |*3*|*5* | 4   | 6 | 1 | 4 | 2 | 3 | 4 | 4 .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|346|<1>|346 |46  |*5*|<2> | 3   | 2 | 4 | 1 | 4 | 2 | 5 | 3
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|46 |456|246 |2456|*1*|*3* | 2   | 3 | 5 | 2 | 5 | 1 | 3 | 2 . . .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|346|456|1346|456 |*2*| 14 | 1   | 1 | 6 | 3 | 6 | 6 | 6 | 1
'--------------------------'     '-----------------------'
a   b   c   d    e   f          a   b   c   d   e   f

d4 is 4 or 6 (can't be 2 because that would give a second match in that row). So, b4 and d4 are 4 or 6, and c4 is 2 or 6 (again, can't be 4 to avoid a second match in row 4). Since one of b4, c4 is 6, c4=2. We also have 4,6 as the only possible digits at d3,d4, and since d1 is 4,5 or 6, we must have d1=5. The only place for 2 at column d is d2=2. The only place for 5 at row 2 is b2=5 (fulfilling the matching requirement for row 2 and column b). We must have b1=4 (since it can't be 6 to avoid additional matching at column b), and so b4=6, d4=4, d3=6 (fulfilling the matching constraint for column d) and f1=1, f5=4, c5=1 (constraint for row 5 satisfied).

.           .
.       .   .
.   .       .   .   .
.--------------------------.     .-----------------------.
|*2*|*3*|<5> |*1* |*4*|*6* | 6   | 4 | 3 | 6 | 1 | 4 | 1 | 6 . . .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|*5*|*2*|*1* |*3* |<6>|*4* | 5   | 5 | 2 | 5 | 3 | 5 | 2 | 5 . . .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|*1*|*6*|*2* |*4* |*3*|*5* | 4   | 6 | 1 | 4 | 2 | 3 | 4 | 4 .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|34 |<1>| 34 |*6* |*5*|<2> | 3   | 2 | 4 | 1 | 4 | 2 | 5 | 3
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|46 |*5*| 46 |*2* |*1*|*3* | 2   | 3 | 5 | 2 | 5 | 1 | 3 | 2 . . .
|---+---+----+----+---+----|     |---+---+---+---+---+---|
|36 |*4*| 36 |*5* |*2*|*1* | 1   | 1 | 6 | 3 | 6 | 6 | 6 | 1
'--------------------------'     '-----------------------'
a   b   c   d    e   f          a   b   c   d   e   f

Now, to avoid any matching at column c, c1=6, a1=3,a3=4,a2=6,c2=4,c3=3, solving the puzzle.