package main

import "fmt"

func UpdateSlice(strSlice []string, cmpStr string) {
	sliceSize := len(strSlice)
	for i := 0; i < sliceSize; i++ {
		if cmpStr == strSlice[i] {
			strSlice = strSlice[:i]
			break
		}
	}
	fmt.Println(strSlice)
}

func GrowSlice(strSlice []string, appStr string) {
	strSlice = append(strSlice, appStr)
	fmt.Println(strSlice)
}

func main() {
	strSlice := []string{"aaa", "bbb", "ccc", "ddd"}
	fmt.Println("Before function UpdateSlice: ", strSlice)
	UpdateSlice(strSlice, "ccc")
	fmt.Println("After function UpdateSlice: ", strSlice)
	strSlice = []string{"aaa", "bbb", "ccc", "ddd"}
	fmt.Println("Before function GrowSlice: ", strSlice)
	GrowSlice(strSlice, "eee")
	fmt.Println("After function GrowSlice: ", strSlice)
}
