mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-25 03:11:41 +08:00
规范格式
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user