@@ -0,0 +1,843 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/powx-n/%0A */%0Apublic class Problem50 %7B%0A    public double pow(double x, int n) %7B%0A        if (n %3E= 0) %7B%0A            return powPositive(x, n);%0A        %7D%0A        return powNegative(x, n);%0A    %7D%0A    %0A    private double powPositive(double x, int n) %7B%0A        if (n == 0) %7B%0A            return 1;%0A        %7D%0A        if (n == 1) %7B%0A            return x;%0A        %7D%0A        if (n %25 2 == 0) %7B%0A            return powPositive(x * x, n / 2);%0A        %7D%0A        return x * powPositive(x * x, n / 2);%0A    %7D%0A    %0A    private double powNegative(double x, int n) %7B%0A        if (n == 0) %7B%0A            return 1;%0A        %7D%0A        if (n == 1) %7B%0A            return x;%0A        %7D%0A        if (n %25 2 == 0) %7B%0A            return powNegative(x * x, n / 2);%0A        %7D%0A        return powNegative(x * x, n / 2) / x;%0A    %7D%0A%7D%0A

Solve problem 50