Cody

# Problem 1103. Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

Solution 2195228

Submitted on 6 Apr 2020 by Pauli Huusari
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(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))

c = 0×0 empty cell array add_a_triplet = 15 112 113 add_a_triplet = 40 96 104 add_a_triplet = 48 90 102 add_a_triplet = 60 80 100 add_a_triplet = 60 80 100 add_a_triplet = 48 90 102 add_a_triplet = 40 96 104 add_a_triplet = 15 112 113 c{1} = 15 112 113 c{2} = 40 96 104 c{3} = 48 90 102 c{4} = 60 80 100

2   Pass
assert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))

c = 0×0 empty cell array add_a_triplet = 15 112 113 add_a_triplet = 40 96 104 add_a_triplet = 48 90 102 add_a_triplet = 60 80 100 add_a_triplet = 60 80 100 add_a_triplet = 48 90 102 add_a_triplet = 40 96 104 add_a_triplet = 15 112 113 c{1} = 15 112 113 c{2} = 40 96 104 c{3} = 48 90 102 c{4} = 60 80 100

3   Pass
assert(isequal(right_triangle_sides(418),{ [57 176 185] }))

c = 0×0 empty cell array add_a_triplet = 57 176 185 add_a_triplet = 57 176 185 c{1} = 57 176 185

4   Pass
assert(isequal(right_triangle_sides(490),{ [140 147 203] }))

c = 0×0 empty cell array add_a_triplet = 140 147 203 add_a_triplet = 140 147 203 c{1} = 140 147 203

5   Pass
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))

c = 0×0 empty cell array add_a_triplet = 14 48 50 add_a_triplet = 14 48 50 c{1} = 14 48 50

6   Pass
assert(isequal(right_triangle_sides(390),{ [52 165 173] [65 156 169] }))

c = 0×0 empty cell array add_a_triplet = 52 165 173 add_a_triplet = 65 156 169 add_a_triplet = 65 156 169 add_a_triplet = 52 165 173 c{1} = 52 165 173 c{2} = 65 156 169

7   Pass
assert(isequal(right_triangle_sides(132),{ [11 60 61] [33 44 55] }))

c = 0×0 empty cell array add_a_triplet = 11 60 61 add_a_triplet = 33 44 55 add_a_triplet = 33 44 55 add_a_triplet = 11 60 61 c{1} = 11 60 61 c{2} = 33 44 55

8   Pass
assert(isequal(right_triangle_sides(576),{ [64 252 260] [144 192 240] }))

c = 0×0 empty cell array add_a_triplet = 64 252 260 add_a_triplet = 144 192 240 add_a_triplet = 144 192 240 add_a_triplet = 64 252 260 c{1} = 64 252 260 c{2} = 144 192 240

9   Pass
assert(isequal(right_triangle_sides(60),{ [10 24 26] [15 20 25] }))

c = 0×0 empty cell array add_a_triplet = 10 24 26 add_a_triplet = 15 20 25 add_a_triplet = 15 20 25 add_a_triplet = 10 24 26 c{1} = 10 24 26 c{2} = 15 20 25

10   Pass
assert(isequal(right_triangle_sides(650),{ [25 312 313] }))

c = 0×0 empty cell array add_a_triplet = 25 312 313 add_a_triplet = 25 312 313 c{1} = 25 312 313

11   Pass
assert(isequal(right_triangle_sides(732),{ [183 244 305] }))

c = 0×0 empty cell array add_a_triplet = 183 244 305 add_a_triplet = 183 244 305 c{1} = 183 244 305

12   Pass
assert(isequal(right_triangle_sides(648),{ [162 216 270] }))

c = 0×0 empty cell array add_a_triplet = 162 216 270 add_a_triplet = 162 216 270 c{1} = 162 216 270

13   Pass
assert(isequal(right_triangle_sides(930),{ [155 372 403] }))

c = 0×0 empty cell array add_a_triplet = 155 372 403 add_a_triplet = 155 372 403 c{1} = 155 372 403

14   Pass
assert(isequal(right_triangle_sides(876),{ [219 292 365] }))

c = 0×0 empty cell array add_a_triplet = 219 292 365 add_a_triplet = 219 292 365 c{1} = 219 292 365

15   Pass
assert(isequal(right_triangle_sides(588),{ [84 245 259] [147 196 245] }))

c = 0×0 empty cell array add_a_triplet = 84 245 259 add_a_triplet = 147 196 245 add_a_triplet = 147 196 245 add_a_triplet = 84 245 259 c{1} = 84 245 259 c{2} = 147 196 245

16   Pass
assert(isequal(right_triangle_sides(208),{ [39 80 89] }))

c = 0×0 empty cell array add_a_triplet = 39 80 89 add_a_triplet = 39 80 89 c{1} = 39 80 89

17   Pass
assert(isequal(right_triangle_sides(228),{ [57 76 95] }))

c = 0×0 empty cell array add_a_triplet = 57 76 95 add_a_triplet = 57 76 95 c{1} = 57 76 95

18   Pass
assert(isequal(right_triangle_sides(312),{ [24 143 145] [78 104 130] }))

c = 0×0 empty cell array add_a_triplet = 24 143 145 add_a_triplet = 78 104 130 add_a_triplet = 78 104 130 add_a_triplet = 24 143 145 c{1} = 24 143 145 c{2} = 78 104 130

19   Pass
assert(isequal(right_triangle_sides(924),{ [42 440 442] [77 420 427] [132 385 407] [198 336 390] [231 308 385] }))

c = 0×0 empty cell array add_a_triplet = 42 440 442 add_a_triplet = 77 420 427 add_a_triplet = 132 385 407 add_a_triplet = 198 336 390 add_a_triplet = 231 308 385 add_a_triplet = 231 308 385 add_a_triplet = 198 336 390 add_a_triplet = 132 385 407 add_a_triplet = 77 420 427 add_a_triplet = 42 440 442 c{1} = 42 440 442 c{2} = 77 420 427 c{3} = 132 385 407 c{4} = 198 336 390 c{5} = 231 308 385

20   Pass
assert(isequal(right_triangle_sides(980),{ [280 294 406] }))

c = 0×0 empty cell array add_a_triplet = 280 294 406 add_a_triplet = 280 294 406 c{1} = 280 294 406

21   Pass
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))

c = 0×0 empty cell array add_a_triplet = 14 48 50 add_a_triplet = 14 48 50 c{1} = 14 48 50

22   Pass
assert(isequal(right_triangle_sides(30),{ [5 12 13] }))

c = 0×0 empty cell array add_a_triplet = 5 12 13 add_a_triplet = 5 12 13 c{1} = 5 12 13

23   Pass
assert(isequal(right_triangle_sides(680),{ [102 280 298] [136 255 289] }))

c = 0×0 empty cell array add_a_triplet = 102 280 298 add_a_triplet = 136 255 289 add_a_triplet = 136 255 289 add_a_triplet = 102 280 298 c{1} = 102 280 298 c{2} = 136 255 289

24   Pass
assert(isequal(right_triangle_sides(396),{ [33 180 183] [72 154 170] [99 132 165] }))

c = 0×0 empty cell array add_a_triplet = 33 180 183 add_a_triplet = 72 154 170 add_a_triplet = 99 132 165 add_a_triplet = 99 132 165 add_a_triplet = 72 154 170 add_a_triplet = 33 180 183 c{1} = 33 180 183 c{2} = 72 154 170 c{3} = 99 132 165

25   Pass
assert(isequal(right_triangle_sides(988),{ [266 312 410] }))

c = 0×0 empty cell array add_a_triplet = 266 312 410 add_a_triplet = 266 312 410 c{1} = 266 312 410