MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / pow

Function pow

JavaScript/50.Powxn.js:47–57  ·  view source on GitHub ↗
(x, n)

Source from the content-addressed store, hash-verified

45 return pow(x, n);
46
47 function pow(x, n) {
48 if (n == 0) {
49 return 1.0;
50 }
51 const half = pow(x, parseInt(n / 2));
52 if (n % 2 === 0) {
53 return half * half;
54 } else {
55 return half * half * x;
56 }
57 }
58};

Callers 3

myPowFunction · 0.85
kClosestMethod · 0.85
titleToNumberMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected