Ad
fn s(a:&mut[u8]){let z=a.len();for b in 0..z*z{if a[b/z]<a[b%z]{a.swap(b%z,b/z)}}}

only 1 line less and more readable var names

Code
Diff
  • fn flip_the_number(&(mut n): &u64) -> u64 {
        let mut out = 0;
        while n > 0 {
            out = out * 10 + n % 10;
            n /= 10;
        }
        out
    }
    • fn flip_the_number(x: &u64) -> u64 {
    • let mut x = *x;
    • let mut y = 0;
    • while x != 0 {
    • y = y * 10 + x % 10;
    • x /= 10;
    • fn flip_the_number(&(mut n): &u64) -> u64 {
    • let mut out = 0;
    • while n > 0 {
    • out = out * 10 + n % 10;
    • n /= 10;
    • }
    • y
    • out
    • }