Cody

Solution 1752123

Submitted on 15 Mar 2019 by Karl Ezra Pilario
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
assert(isequal(within_circle(1),5))

2   Pass
assert(isequal(within_circle(3),9))

3   Pass
assert(isequal(within_circle(20),69))

4   Pass
assert(isequal(within_circle(45),145))

5   Pass
assert(isequal(within_circle(55),177))

6   Pass
assert(isequal(within_circle(500),1581))

7   Pass
assert(isequal(within_circle(10000),31417))

8   Pass
assert(isequal(within_circle(50000),157093))

9   Pass
assert(isequal(within_circle(999999),3141521))

10   Pass
assert(isequal(within_circle(9999999),31415993))

11   Pass
assert(isequal(within_circle(99999999),314159017)) % Approaching to Pi...

12   Pass
filetext = fileread('within_circle.m'); assert(isempty(strfind(filetext, 'switch'))) assert(isempty(strfind(filetext, 'case'))) assert(isempty(strfind(filetext, 'if')))