diff options
Diffstat (limited to 'other/max_69.rs')
-rw-r--r-- | other/max_69.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/other/max_69.rs b/other/max_69.rs new file mode 100644 index 0000000..0bead97 --- /dev/null +++ b/other/max_69.rs @@ -0,0 +1,11 @@ +struct Solution; + +impl Solution { + pub fn maximum69_number(num: i32) -> i32 { + num.to_string().replacen("6", "9", 1).parse().unwrap() + } +} + +fn main() { + print!("{}", Solution::maximum69_number(9669)); +} |