golang solution


  • 0
    C
    import "math"
    
    func newInteger(n int) int {
        res := 0
        for i := 0; n > 0; i++ {
            res += n%9*int(math.Pow10(i))
            n /= 9
        }
    
        return res
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.