优化大型数组中的值比较-Go

I am trying to learn Go, and made an attempt at solving the problem explained here https://projecteuler.net/problem=215

I made a solution that works, but it takes a very long time to compute once the problem gets complex, literally running for hours without solving the question so i assume i need to optimize my solution somehow. Below is my code

package main

import "fmt"

func main() {
    fmt.Println(wall(18, 10))
}

func wall(width, height int) int64 {

    var total int64

    combinations := findCombinations(width)

    combiPointer := &combinations

    for i := 0; i < 4; i++ {
        for _, a := range combinations[i] {
            if i%2 == 0 {
                buildWall(a, combiPointer[i+1], 0, height, i+1, &total, combiPointer)
            } else {
                buildWall(a, combiPointer[i-1], 0, height, i-1, &total, combiPointer)
            }
        }
    }
return total
}

func buildWall(a []int, combi [][]int, level, height, index int, total *int64, pointer *[4][][]int) {
level++
var canCombine bool
for _, a1 := range combi {
    canCombine = true
    for _, value := range a {
            if canCombine == false {
                break
            }
            for _, value1 := range a1 {
                if value == value1 {
                    canCombine = false
                    break
                }
            }
        }
        if canCombine == true && level < height {

            if index%2 == 0 {
                buildWall(a1, pointer[index+1], level, height, index+1, total, pointer)
            } else {
                buildWall(a1, pointer[index-1], level, height, index-1, total, pointer)
            }
        } else if level == height {
            *total++
            break
        }
    }
}

findCombinations works fine and returns a three dimensional array with all possible solutions. The arrays in [0] and [1] can (maybe) be put on top of each other without a crack occuring. Same for [2] and [3]. I choose to cut the array of all solutions up in 4 arrays by looking at the position of the first and last block used to build the wall as i assumed it would increase performance to loop over smaller arrays.

func findCombinations(width int) [4][][]int {
    var i int
    var tmp int
    var tmpInt1 int
    var tmpInt2 int
    open := make([][]int, 0, 100)
    var solutionsHolder [4][][]int
    open = append(open, []int{3, 2})
    tmpArray := make([]int, 0, 100)

    for {
        if len(open[i]) > 0 {
            tmpArray = append(tmpArray[:i], open[i][0])
            open[i] = append(open[i][:0], open[i][1:]...)
            counter := 0
            for _, x := range tmpArray {
                counter += x
            }
            if counter == width {
                solutionArray := make([]int, len(tmpArray)-1)
                counter2 := 0
                for n := 0; n < len(tmpArray)-1; n++ {
                    if n == 0 {
                        tmpInt1 = tmpArray[n] % 2
                    }
                    counter2 += tmpArray[n]
                    solutionArray[n] = counter2
                }
                tmpInt2 = counter2 % 2
                if tmpInt1 == 0 && tmpInt2 == 0 {
                    solutionsHolder[0] = append(solutionsHolder[0], solutionArray)
                } else if tmpInt1 == 1 && tmpInt2 == 1 {
                    solutionsHolder[1] = append(solutionsHolder[1], solutionArray)
                } else if tmpInt1 == 1 && tmpInt2 == 0 {
                    solutionsHolder[2] = append(solutionsHolder[2], solutionArray)
                } else {
                    solutionsHolder[3] = append(solutionsHolder[3], solutionArray)
                }

                for _, v := range open {
                    tmp += len(v)
                }
                if tmp == 0 {
                    return solutionsHolder
                }
                tmp = 0
            } else if counter > width {
                for _, v := range open {
                    tmp += len(v)
                }
                if tmp == 0 {
                   return solutionsHolder
                }
                tmp = 0
            } else if counter < width {
                i++
                if len(open) <= i {
                    open = append(open, []int{3, 2})
                } else {
                    open[i] = append(open[i], []int{3, 2}...)
                }
            }
        } else {
            i--
        }
    }
}

Its the wall function that calls a recursive function which will run for a very long time (i've had it run for an hour without a result) if you insert a width and height of wall(32,10) as they want you to compute on the website.

buildWall() which is called by wall checks whether there is no crack on the same position for two solutions and if this is the case it runs buildWall again for the next level of the wall until the walls height is reached. It does this for every solutions comparing it to all other possible solutions, though limited to one subset of the 3d array.

I'm thinking maybe there is another approach to find all the possible walls that can be combined, but i can't seem to wrap my head around it.