Length of Last Word LeetCode solution in Rust

1
impl Solution {
2
pub fn length_of_last_word(s: String) -> i32 {
3
s.trim_end()
4
.chars()
5
.rev()
6
.take_while(|c| c.is_alphabetic())
7
.count() as i32
8
}
9
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0