Strictly speaking, your Test Suite only matches the principal root. For example, in the first test case, −1 is also a valid root, as (−1)¹⁰⁰ = +1. See https://en.wikipedia.org/wiki/Nth_root .
Hello, Srishti Saha . All of the 'correct' solutions are requiring rounding of the outputs to pass your Test Suite. That should not be necessary unless you specify it in the Problem Statement; otherwise your Test Suite should allow a tolerance to account for 'floating point errors'. (See Problem 44631.) Please amend. —DIV
12490 Solvers
2519 Solvers
Back to basics 21 - Matrix replicating
1058 Solvers
525 Solvers
Basic commands - Greatest common divisor
124 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!