One Pass Go Easy Solution !!!
One Pass Solution !!!Complexity

Time complexity:
O(n)


Space complexity:
O(1)

Code
# One Pass Solution !!!
# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```golang []
func applyOperations(nums []int) []int {
	insertPos := 0
	for i := 0; i < len(nums); i++ {
		if i+1 < len(nums) && nums[i] == nums[i+1] {
			nums[i] *= 2
			nums[i+1] = 0
		}
		if nums[i] != 0 {
			nums[insertPos], nums[i] = nums[i], nums[insertPos]
			insertPos++
		}
	}
	return nums
}
```
['Array', 'Go']