Cody

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

Solution 1985024

Submitted on 21 Oct 2019 by Eugene Kronberg
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] }))

z = 60 48 40 15 ind = 4 3 2 1 ans = 15 112 113 ans = 60 80 100

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

z = 60 48 40 15 ind = 4 3 2 1 ans = 15 112 113 ans = 60 80 100

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

z = 57 ind = 1 ans = 57 176 185 ans = 57 176 185

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

z = 140 ind = 1 ans = 140 147 203 ans = 140 147 203

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

z = 14 ind = 1 ans = 14 48 50 ans = 14 48 50

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

z = 65 52 ind = 2 1 ans = 52 165 173 ans = 65 156 169

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

z = 33 11 ind = 2 1 ans = 11 60 61 ans = 33 44 55

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

z = 144 64 ind = 2 1 ans = 64 252 260 ans = 144 192 240

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

z = 15 10 ind = 2 1 ans = 10 24 26 ans = 15 20 25

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

z = 25 ind = 1 ans = 25 312 313 ans = 25 312 313

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

z = 183 ind = 1 ans = 183 244 305 ans = 183 244 305

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

z = 162 ind = 1 ans = 162 216 270 ans = 162 216 270

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

z = 155 ind = 1 ans = 155 372 403 ans = 155 372 403

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

z = 219 ind = 1 ans = 219 292 365 ans = 219 292 365

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

z = 147 84 ind = 2 1 ans = 84 245 259 ans = 147 196 245

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

z = 39 ind = 1 ans = 39 80 89 ans = 39 80 89

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

z = 57 ind = 1 ans = 57 76 95 ans = 57 76 95

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

z = 78 24 ind = 2 1 ans = 24 143 145 ans = 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] }))

z = 231 198 132 77 42 ind = 5 4 3 2 1 ans = 42 440 442 ans = 231 308 385

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

z = 280 ind = 1 ans = 280 294 406 ans = 280 294 406

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

z = 14 ind = 1 ans = 14 48 50 ans = 14 48 50

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

z = 5 ind = 1 ans = 5 12 13 ans = 5 12 13

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

z = 136 102 ind = 2 1 ans = 102 280 298 ans = 136 255 289

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

z = 99 72 33 ind = 3 2 1 ans = 33 180 183 ans = 99 132 165

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

z = 266 ind = 1 ans = 266 312 410 ans = 266 312 410