()
| 10 | // 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 |
| 11 | |
| 12 | fn main() { |
| 13 | let image = vec!( |
| 14 | vec!(1,1,0), |
| 15 | vec!(1,0,1), |
| 16 | vec!(0,0,0) |
| 17 | ); |
| 18 | let res = flip_and_invert_image(image); |
| 19 | println!("{:?}", res); |
| 20 | } |
| 21 | |
| 22 | pub fn flip_and_invert_image(image: Vec<Vec<i32>>) -> Vec<Vec<i32>> { |
| 23 | image.into_iter().map(|row|row.into_iter().rev().map(|pixel|pixel ^ 1).collect()).collect() |
nothing calls this directly
no test coverage detected