(s: String)
| 1 | pub fn backspace_compare(s: String, t: String) -> bool { |
| 2 | fn get_chars(s: String) -> Vec<char> { |
| 3 | let s_chars: Vec<char> = s.chars().collect(); |
| 4 | let mut cs = vec!(); |
| 5 | for c in s_chars { |
| 6 | if c != '#' { |
| 7 | cs.push(c); |
| 8 | } else { |
| 9 | cs.pop(); |
| 10 | } |
| 11 | } |
| 12 | cs |
| 13 | } |
| 14 | get_chars(s) == get_chars(t) |
| 15 | } |
| 16 |
no test coverage detected