Remove All Adjacent Duplicates In String Solutions in GoNumber 1047Difficulty EasyAcceptance 68.6%Link LeetCodeOther languages C++SolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func removeDuplicates1047(S string) string { stack := []rune{} for _, s := range S { if len(stack) == 0 || len(stack) > 0 && stack[len(stack)-1] != s { stack = append(stack, s) } else { stack = stack[:len(stack)-1] } } return string(stack)}package leetcode func removeDuplicates1047(S string) string { stack := []rune{} for _, s := range S { if len(stack) == 0 || len(stack) > 0 && stack[len(stack)-1] != s { stack = append(stack, s) } else { stack = stack[:len(stack)-1] } } return string(stack) }