Ad
Code
Diff
  • export const flip_the_number = (x: number): number => {
        return Number(Array.from(x.toString()).reduce((acc, s) => s + acc, ""));
    }
    • 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;
    • }
    • y
    • export const flip_the_number = (x: number): number => {
    • return Number(Array.from(x.toString()).reduce((acc, s) => s + acc, ""));
    • }