Function
dest_city
(paths: Vec<Vec<String>>)
Source from the content-addressed store, hash-verified
| 8 | } |
| 9 | |
| 10 | pub fn dest_city(paths: Vec<Vec<String>>) -> String { |
| 11 | let mut res = vec!(); |
| 12 | for path in paths { |
| 13 | for (i, des) in path.into_iter().enumerate() { |
| 14 | if res.contains(&des) { |
| 15 | res.retain(|value| *value != des); |
| 16 | } else { |
| 17 | if i == 0 { |
| 18 | res.insert(0, des); |
| 19 | } else { |
| 20 | res.push(des); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | res[1].to_string() |
| 26 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected