I dont understand where and why is this failing. Please help.


  • 0
    D

    class Solution {
    public:
    double myPow(double x, int n) {
    if(n<0)
    return myPow((double)1.00000/x,-n);
    if(n==0)
    return 1.00000;
    if(n==1)
    return x;
    if(!n%2)
    return myPow(xx,n/2);
    else
    return x
    myPow(x*x,(n-1)/2);
    }
    };


Log in to reply
 

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