We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int the recursive function `int rec(const vector& A, int B, const vector& C, int pos) { if(B == 0) { return 0;}
int n = A.size(); int i, count = 0; for(i = 0; i < n; i++) { if(A[i] >= C[pos]) { break; } count++; } if(pos == 0 && A[0] == 0)
{the above if statement should also include "B!=1" so that if an array(A[1]={0}) is passed as an input with B as 1 and C as 5, it would not return 0
count--; } int result = count * pow(n, B - 1); if(i == n || A[i] != C[pos]) { return result; } return result + rec(A, B - 1, C, pos + 1);
} `
The text was updated successfully, but these errors were encountered:
I may not have detailed knowledge of coding for now but this was the case I observed and it got solved
Sorry, something went wrong.
No branches or pull requests
int the recursive function
`int rec(const vector& A, int B, const vector& C, int pos)
{
if(B == 0) {
return 0;}
}
`
The text was updated successfully, but these errors were encountered: