Split a String in Balanced Strings Solutions in GoNumber 1221Difficulty EasyAcceptance 83.3%Link LeetCodeOther languages C++SolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func balancedStringSplit(s string) int { count, res := 0, 0 for _, r := range s { if r == 'R' { count++ } else { count-- } if count == 0 { res++ } } return res}package leetcode func balancedStringSplit(s string) int { count, res := 0, 0 for _, r := range s { if r == 'R' { count++ } else { count-- } if count == 0 { res++ } } return res }