MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / main

Function main

832-flipping-an-image.rs:12–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10// 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
11
12fn 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
22pub 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()

Callers

nothing calls this directly

Calls 1

flip_and_invert_imageFunction · 0.85

Tested by

no test coverage detected