You are viewing a single comment's thread. Return to all comments →
int findPows(int X, int num, int N) {
int val = X - pow(num, N); if (val < 0) { return 0; } if (val == 0) { return 1; } return findPows(val, num + 1, N) + findPows(X, num + 1, N);
}
int powerSum(int X, int N) { return findPows(X, 1, N); }
Seems like cookies are disabled on this browser, please enable them to open this website
The Power Sum
You are viewing a single comment's thread. Return to all comments →
int findPows(int X, int num, int N) {
}
int powerSum(int X, int N) { return findPows(X, 1, N); }