class Solution {
public double myPow(double x, int n) {
if(n==0)
return 1 ;
double pnm1 = myPow(x , n-1);
double pow = x*pnm1 ;
return pow ;
}
}
When I am running this code on leetcode I am getting an error "
WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
java.lang.StackOverflowError
at line 7, Solution.myPow
at line 7, Solution.myPow"