You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Solution.go
    path of file: ./repos/awesome-golang-algorithm/leetcode/701-800/0735.Asteroid-Collision
    
    the code of the file until where you have to start completion: package Solution

func Solution(asteroids []int) []int {
	latestIndex := 0

	for idx := 1; idx < len(asteroids); idx++ {
		if latestIndex < 0 || asteroids[latestIndex] < 0 || asteroids[idx] > 0 {
			latestIndex++
			asteroids[latestIndex] = asteroids[idx]
			continue
		}
		// latest > 0 && a
    
func Solution(asteroids []int) []int {
	latestIndex := 0

	for idx := 1; idx < len(asteroids); idx++ {
		if latestIndex < 0 || asteroids[latestIndex] < 0 || asteroids[idx] > 0 {
			latestIndex++
			asteroids[latestIndex] = asteroids[idx]
			continue
		}
		// latest > 0 && asteroids[idx] < 0
		add := true
		rev := -asteroids[idx]
		for latestIndex >= 0 {
			if asteroids[latestIndex] < 0 {
				break
			}

			if asteroids[latestIndex] == rev {
				latestIndex--
				add = false
				break
			}
			if asteroids[latestIndex] > rev {
				add = false
				break
			}
			latestIndex--
		}

		if add {
			latestIndex++
			asteroids[latestIndex] = asteroids[idx]
		}
	}
	return asteroids[:latestIndex+1]
}