16 lines
245 B
Go
16 lines
245 B
Go
package q2011
|
|
|
|
func finalValueAfterOperations(operations []string) int {
|
|
x := 0
|
|
for i := range operations {
|
|
switch operations[i] {
|
|
case "X++", "++X":
|
|
x++
|
|
case "X--", "--X":
|
|
x--
|
|
}
|
|
}
|
|
return x
|
|
}
|
|
|
|
var _ = finalValueAfterOperations
|