Cody

# Problem 1493. Dots in a Diamond

Solution 2130640

Submitted on 16 Feb 2020
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
user_solution = fileread('dots_in_diamond.m'); assert(isempty(strfind(user_solution,'regexp'))); assert(isempty(strfind(user_solution,'2str'))); assert(isempty(strfind(user_solution,'str2'))); assert(isempty(strfind(user_solution,'interp'))); assert(isempty(strfind(user_solution,'printf'))); assert(isempty(strfind(user_solution,'assert')));

2   Fail
r = 0; N_correct = 1; assert(isequal(dots_in_diamond(r),N_correct));

n = 0

Assertion failed.

3   Fail
r = 0.5; N_correct = 1; assert(isequal(dots_in_diamond(r),N_correct));

n = 0.4310

Assertion failed.

4   Fail
r = 1; N_correct = 5; assert(isequal(dots_in_diamond(r),N_correct));

n = 1

Assertion failed.

5   Fail
r = 1.5; N_correct = 5; assert(isequal(dots_in_diamond(r),N_correct));

n = 1.6362

Assertion failed.

6   Fail
r = 1.74; N_correct = 17; assert(isequal(dots_in_diamond(r),N_correct));

n = 1.9593

Assertion failed.

7   Fail
r = 2; N_correct = 29; assert(isequal(dots_in_diamond(r),N_correct));

n = 2.3203

Assertion failed.

8   Fail
r = 2.5; N_correct = 35; assert(isequal(dots_in_diamond(r),N_correct));

n = 3.0424

Assertion failed.

9   Fail
r = 3; N_correct = 87; assert(isequal(dots_in_diamond(r),N_correct));

n = 3.7963

Assertion failed.

10   Fail
r = 4; N_correct = 167; assert(isequal(dots_in_diamond(r),N_correct));

n = 5.3836

Assertion failed.

11   Fail
r = 5; N_correct = 357; assert(isequal(dots_in_diamond(r),N_correct));

n = 7.0591

Assertion failed.

12   Fail
r = 6; N_correct = 633; assert(isequal(dots_in_diamond(r),N_correct));

n = 8.8084

Assertion failed.

13   Fail
r = 7; N_correct = 943; assert(isequal(dots_in_diamond(r),N_correct));

n = 10.6216

Assertion failed.

14   Fail
r = 8; N_correct = 1371; assert(isequal(dots_in_diamond(r),N_correct));

n = 12.4913

Assertion failed.

15   Fail
r = 9; N_correct = 1963; assert(isequal(dots_in_diamond(r),N_correct));

n = 14.4120

Assertion failed.

16   Fail
r = 10; N_correct = 2809; assert(isequal(dots_in_diamond(r),N_correct));

n = 16.3789

Assertion failed.

17   Fail
r = 12.5; N_correct = 5359; assert(isequal(dots_in_diamond(r),N_correct));

n = 21.4764

Assertion failed.

18   Fail
r = 15; N_correct = 9249; assert(isequal(dots_in_diamond(r),N_correct));

n = 26.7985

Assertion failed.

19   Fail
r = 17.5; N_correct = 14451; assert(isequal(dots_in_diamond(r),N_correct));

n = 32.3149

Assertion failed.

20   Fail
r = 20; N_correct = 21777; assert(isequal(dots_in_diamond(r),N_correct));

n = 38.0034

Assertion failed.

21   Fail
r = 22.5; N_correct = 31075; assert(isequal(dots_in_diamond(r),N_correct));

n = 43.8466

Assertion failed.

22   Fail
r = 25; N_correct = 42509; assert(isequal(dots_in_diamond(r),N_correct));

n = 49.8309

Assertion failed.