(heights: Vec<i32>)
| 12 | // 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 |
| 13 | |
| 14 | pub fn height_checker(heights: Vec<i32>) -> i32 { |
| 15 | let mut res = 0; |
| 16 | let mut sorted_heights = heights.clone(); |
| 17 | sorted_heights.sort(); |
| 18 | for (i, h) in heights.into_iter().enumerate() { |
| 19 | if h != sorted_heights[i] { |
| 20 | res += 1; |
| 21 | } |
| 22 | } |
| 23 | res |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected