Skip to content

Instantly share code, notes, and snippets.

View elhadjindongo's full-sized avatar

El Hadji Ndongo elhadjindongo

View GitHub Profile
@elhadjindongo
elhadjindongo / find_empty.go
Created December 18, 2022 12:27 — forked from jerryan999/find_empty.go
Solve Sudoku in Golang
func findNextEmpty(board [][]byte) (byte, byte, error) {
for j := byte(0); j < 9; j++ {
for i := byte(0); i < 9; i++ {
if board[j][i] == '.' {
return j, i, nil
}
}
}
return byte(0), byte(0), errors.New("no empty cell to fill in")
}