(s: String)
| 1 | pub fn max_power(s: String) -> i32 { |
| 2 | let mut current_char = '!'; |
| 3 | let mut current_len = 1; |
| 4 | let mut ret = 0; |
| 5 | for c in s.chars() { |
| 6 | if c == current_char { |
| 7 | current_len += 1; |
| 8 | } else { |
| 9 | current_len = 1; |
| 10 | current_char = c; |
| 11 | } |
| 12 | if current_len > ret { |
| 13 | ret = current_len; |
| 14 | } |
| 15 | } |
| 16 | ret |
| 17 | } |
| 18 | |
| 19 | fn main() { |
| 20 | let s = "leetcode".to_string(); |
nothing calls this directly
no outgoing calls
no test coverage detected