func identifyInfiniteElements(grid [][]uint8) []uint8 {
	m := make(map[uint8]int)
	cols := len(grid[0])
	rows := len(grid)
	// top row
	for x := 0; x < cols; x++ {
		m[grid[0][x]]++
	}
	// bottom row
	for x := 0; x < cols; x++ {
		m[grid[rows-1][x]]++
	}
	// "right" column
	for y := 0; y < rows; y++ {
		m[grid[y][0]]++
	}
	// "left" column
	for y := 0; y < rows; y++ {
		m[grid[y][cols-1]]++
	}

	var s []uint8
	for k, _ := range m {
		s = append(s, k)
	}

	return s
}
// returns unique elements in the 4 outer borders of the "grid"
returns unique elements in the 4 outer borders of the "grid"
// returns unique elements in the 4 outer borders of the " grid "
func identifyInfiniteElements(grid [][]uint8) []uint8 {
	m := make(map[uint8]int)
	cols := len(grid[0])
	rows := len(grid)
	for x := 0; x < cols; x++ {
		m[grid[0][x]]++
	}
	for x := 0; x < cols; x++ {
		m[grid[rows-1][x]]++
	}
	for y := 0; y < rows; y++ {
		m[grid[y][0]]++
	}
	for y := 0; y < rows; y++ {
		m[grid[y][cols-1]]++
	}
	var s []uint8
	for k, _ := range m {
		s = append(s, k)
	}
	return s
}
func identifyInfiniteElements ( grid [ ] [ ] uint8 ) [ ] uint8 { m := make ( map [ uint8 ] int ) cols := len ( grid [ 0 ] ) rows := len ( grid ) for x := 0 ; x < cols ; x ++ { m [ grid [ 0 ] [ x ] ] ++ } for x := 0 ; x < cols ; x ++ { m [ grid [ rows - 1 ] [ x ] ] ++ } for y := 0 ; y < rows ; y ++ { m [ grid [ y ] [ 0 ] ] ++ } for y := 0 ; y < rows ; y ++ { m [ grid [ y ] [ cols - 1 ] ] ++ } var s [ ] uint8 for k , _ := range m { s = append ( s , k ) } return s }
returns unique elements in the 4 outer borders of the "grid"
returns unique elements in the 4 outer borders of the " grid "
// top row // bottom row // "right" column // "left" column