(s: String, goal: String)
| 1 | pub fn rotate_string(s: String, goal: String) -> bool { |
| 2 | if s == goal { |
| 3 | return true; |
| 4 | } |
| 5 | let mut s_chars: Vec<char> = s.chars().collect(); |
| 6 | let goal_chars: Vec<char> = goal.chars().collect(); |
| 7 | for _i in 0..s.len() { |
| 8 | s_chars.rotate_left(1); |
| 9 | if s_chars == goal_chars { |
| 10 | return true; |
| 11 | } |
| 12 | } |
| 13 | return false; |
| 14 | } |
| 15 | |
| 16 | fn main() { |
| 17 | let s = "abcde".to_string(); |
nothing calls this directly
no outgoing calls
no test coverage detected