2020-day20: OOF, monster (hah) backtracking algo, and then some...

This commit is contained in:
alexchao26
2020-12-20 15:35:46 -05:00
parent 228a8cda63
commit e1646bfdfd
3 changed files with 385 additions and 17 deletions
+12
View File
@@ -0,0 +1,12 @@
package algos
// MirrorStringGrid returns the grid mirrored over the y-axis (i.e. left to right)
func MirrorStringGrid(grid [][]string) (flipped [][]string) {
for i := range grid {
flipped = append(flipped, []string{})
for j := len(grid[i]) - 1; j >= 0; j-- {
flipped[i] = append(flipped[i], grid[i][j])
}
}
return flipped
}