aboutsummaryrefslogtreecommitdiff
path: root/max_69.rs
diff options
context:
space:
mode:
Diffstat (limited to 'max_69.rs')
-rw-r--r--max_69.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/max_69.rs b/max_69.rs
new file mode 100644
index 0000000..0bead97
--- /dev/null
+++ b/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));
+}