Cody

# Problem 44659. Nth root of a number

Solution 2068722

Submitted on 25 Dec 2019 by Asif Newaz
• Size: 10
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
a = 1; N = 100 y_correct = 1; assert(isequal(rootN(a,N),y_correct))

N = 100 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In rootN (line 3) In ScoringEngineTestPoint1 (line 4) In solutionTest (line 3)] ans = 1

2   Pass
a = [1 64 216]; N = 3 y_correct = [1 4 6]; assert(isequal(rootN(a,N),y_correct))

N = 3 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In rootN (line 3) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)] ans = 1

3   Pass
a = 1/100; N = 2 y_correct = 1/10; assert(isequal(rootN(a,N),y_correct))

N = 2 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In rootN (line 3) In ScoringEngineTestPoint3 (line 4) In solutionTest (line 7)] ans = 1

4   Pass
a = 826^10; N = 10 y_correct = 826; assert(isequal(rootN(a,N),y_correct))

N = 10 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In rootN (line 3) In ScoringEngineTestPoint4 (line 4) In solutionTest (line 9)] ans = 1