MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / good_reverse

Method good_reverse

7. Reverse Integer/src/main.rs:32–42  ·  view source on GitHub ↗
(x: i32)

Source from the content-addressed store, hash-verified

30 }
31
32 pub fn good_reverse(x: i32) -> i32 {
33 x.signum() * x
34 .abs()
35 .to_string()
36 .chars()
37 .rev()
38 .collect::<String>()
39 .parse::<i32>()
40 .unwrap_or(0)
41
42 }
43}
44
45#[cfg(test)]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected