A recursive function that can check if a number num is power a anohter number base.
bool isPowerof(long long num, long long base)
{
if (num <= 0)
return false;
if (num % base == 0)
return isPowerof(num / base, base);
if (num == 1)
return true;
return false;
}
- Limitation : num<= $$$2^{62}$$$ and 2<=base<= $$$2^{62}$$$
- Time complexity : O($$$log_{base}^{num}$$$).
- Sample submission : 169977243.







