https://leetcode.com/problems/baseball-game


Runtime: 0 ms, faster than 100.00% of Go online submissions for Baseball Game.
Memory Usage: 2.7 MB, less than 31.25% of Go online submissions for Baseball Game.



```go
func calPoints(ops []string) int {
	//1:05
	record_list := make([]int, 0)
	for _, operation := range ops {
		if operation == "C" {
			record_list = record_list[:len(record_list)-1]
		} else if operation == "D" {
			record_list = append(record_list, record_list[len(record_list)-1] * 2)
		} else if operation == "+" {
			record_list = append(record_list, record_list[len(record_list)-1] + record_list[len(record_list) -2])
		} else {
			num, _ := strconv.Atoi(operation)
			record_list = append(record_list, num)
		}
	}
	result := 0
	for _, num := range record_list {
		result += num
	}
	return result
	//1:11
}
```
