Cody

Solution 1179589

Submitted on 3 May 2017 by arvid Martens
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
list = [ 1 5 2 1 2 2 3 2 4 8 5 4 5 5 10 3]; correct = [8 4 3 2 1 7 6 5]; assert(isequal(findPerfectOrderedDominoes(list),correct))

bool = logical 1 ii = 2 ii = 3 ii = 4 ii = 5 ii = 6 ii = 7 ii = 8 ii = 9 ii = 10 ii = 11 ii = 12 ii = 13 ii = 14 ii = 15 ii = 16 ii = 17 ii = 18 ii = 19 ii = 20 ii = 21 ii = 22 ii = 23 ii = 24 ii = 25 ii = 26 ii = 27 ii = 28 ii = 29 ii = 30 ii = 31 ii = 32 ii = 33 ii = 34 ii = 35 ii = 36 ii = 37 ii = 38 ii = 39 ii = 40 ii = 41 ii = 42 ii = 43 ii = 44 ii = 45 ii = 46 ii = 47 ii = 48 ii = 49 ii = 50 ii = 51 ii = 52 ii = 53 ii = 54 ii = 55 ii = 56 ii = 57 ii = 58 ii = 59 ii = 60 ii = 61 ii = 62 ii = 63 ii = 64 ii = 65 ii = 66 ii = 67 ii = 68 ii = 69 ii = 70 ii = 71 ii = 72 ii = 73 ii = 74 ii = 75 ii = 76 ii = 77 ii = 78 ii = 79 ii = 80 ii = 81 ii = 82 ii = 83 ii = 84 ii = 85 ii = 86 ii = 87 ii = 88 ii = 89 ii = 90 ii = 91 ii = 92 ii = 93 ii = 94 ii = 95 ii = 96 ii = 97 ii = 98 ii = 99 ii = 100 ii = 101 ii = 102 ii = 103 ii = 104 ii = 105 ii = 106 ii = 107 ii = 108 ii = 109 ii = 110 ii = 111 ii = 112 ii = 113 ii = 114 ii = 115 ii = 116 ii = 117 ii = 118 ii = 119 ii = 120 ii = 121 ii = 122 ii = 123 ii = 124 ii = 125 ii = 126 ii = 127 ii = 128 ii = 129 ii = 130 ii = 131 ii = 132 ii = 133 ii = 134 ii = 135 ii = 136 ii = 137 ii = 138 ii = 139 ii = 140 ii = 141 ii = 142 ii = 143 ii = 144 ii = 145 ii = 146 ii = 147 ii = 148 ii = 149 ii = 150 ii = 151 ii = 152 ii = 153 ii = 154 ii = 155 ii = 156 ii = 157 ii = 158 ii = 159 ii = 160 ii = 161 ii = 162 ii = 163 ii = 164 ii = 165 ii = 166 ii = 167 ii = 168 ii = 169 ii = 170 ii = 171 ii = 172 ii = 173 ii = 174 ii = 175 ii = 176 ii = 177 ii = 178 ii = 179 ii = 180 ii = 181 ii = 182 ii = 183 ii = 184 ii = 185 ii = 186 ii = 187 ii = 188 ii = 189 ii = 190 ii = 191 ii = 192 ii = 193 ii = 194 ii = 195 ii = 196 ii = 197 ii = 198 ii = 199 ii = 200 ii = 201 ii = 202 ii = 203 ii = 204 ii = 205 ii = 206 ii = 207 ii = 208 ii = 209 ii = 210 ii = 211 ii = 212 ii = 213 ii = 214 ii = 215 ii = 216 ii = 217 ii = 218 ii = 219 ii = 220 ii = 221 ii = 222 ii = 223 ii = 224 ii = 225 ii = 226 ii = 227 ii = 228 ii = 229 ii = 230 ii = 231 ii = 232 ii = 233 ii = 234 ii = 235 ii = 236 ii = 237 ii = 238 ii = 239 ii = 240 ii = 241 ii = 242 ii = 243 ii = 244 ii = 245 ii = 246 ii = 247 ii = 248 ii = 249 ii = 250 ii = 251 ii = 252 ii = 253 ii = 254 ii = 255 ii = 256 ii = 257 ii = 258 ii = 259 ii = 260 ii = 261 ii = 262 ii = 263 ii = 264 ii = 265 ii = 266 ii = 267 ii = 268 ii = 269 ii = 270 ii = 271 ii = 272 ii = 273 ii = 274 ii = 275 ii = 276 ii = 277 ii = 278 ii = 279 ii = 280 ii = 281 ii = 282 ii = 283 ii = 284 ii = 285 ii = 286 ii = 287 ii = 288 ii = 289 ii = 290 ii = 291 ii = 292 ii = 293 ii = 294 ii = 295 ii = 296 ii = 297 ii = 298 ii = 299 ii = 300 ii = 301 ii = 302 ii = 303 ii = 304 ii = 305 ii = 306 ii = 307 ii = 308 ii = 309 ii = 310 ii = 311 ii = 312 ii = 313 ii = 314 ii = 315 ii = 316 ii = 317 ii = 318 ii = 319 ii = 320 ii = 321 ii = 322 ii = 323 ii = 324 ii = 325 ii = 326 ii = 327 ii = 328 ii = 329 ii = 330 ii = 331 ii = 332 ii = 333 ii = 334 ii = 335 ii = 336 ii = 337 ii = 338 ii = 339 ii = 340 ii = 341 ii = 342 ii = 343 ii = 344 ii = 345 ii = 346 ii = 347 ii = 348 ii = 349 ii = 350 ii = 351 ii = 352 ii = 353 ii = 354 ii = 355 ii = 356 ii = 357 ii = 358 ii = 359 ii = 360 ii = 361 ii = 362 ii = 363 ii = 364 ii = 365 ii = 366 ii = 367 ii = 368 ii = 369 ii = 370 ii = 371 ii = 372 ii = 373 ii = 374 ii = 375 ii = 376 ii = 377 ii = 378 ii = 379 ii = 380 ii = 381 ii = 382 ii = 383 ii = 384 ii = 385 ii = 386 ii = 387 ii = 388 ii = 389 ii = 390 ii = 391 ii = 392 ii = 393 ii = 394 ii = 395 ii = 396 ii = 397 ii = 398 ii = 399 ii = 400 ii = 401 ii = 402 ii = 403 ii = 404 ii = 405 ii = 406 ii = 407 ii = 408 ii = 409 ii = 410 ii = 411 ii = 412 ii = 413 ii = 414 ii = 415 ii = 416 ii = 417 ii = 418 ii = 419 ii = 420 ii = 421 ii = 422 ii = 423 ii = 424 ii = 425 ii = 426 ii = 427 ii = 428 ii = 429 ii = 430 ii = 431 ii = 432 ii = 433 ii = 434 ii = 435 ii = 436 ii = 437 ii = 438 ii = 439 ii = 440 ii = 441 ii = 442 ii = 443 ii = 444 ii = 445 ii = 446 ii = 447 ii = 448 ii = 449 ii = 450 ii = 451 ii = 452 ii = 453 ii = 454 ii = 455 ii = 456 ii = 457 ii = 458 ii = 459 ii = 460 ii = 461 ii = 462 ii = 463 ii = 464 ii = 465 ii = 466 ii = 467 ii = 468 ii = 469 ii = 470 ii = 471 ii = 472 ii = 473 ii = 474 ii = 475 ii = 476 ii = 477 ii = 478 ii = 479 ii = 480 ii = 481 ii = 482 ii = 483 ii = 484 ii = 485 ii = 486 ii = 487 ii = 488 ii = 489 ii = 490 ii = 491 ii = 492 ii = 493 ii = 494 ii = 495 ii = 496 ii = 497 ii = 498 ii = 499 ii = 500 ii = 501 ii = 502 ii = 503 ii = 504 ii = 505 ii = 506 ii = 507 ii = 508 ii = 509 ii = 510 ii = 511 ii = 512 ii = 513 ii = 514 ii = 515 ii = 516 ii = 517 ii = 518 ii = 519 ii = 520 ii = 521 ii = 522 ii = 523 ii = 524 ii = 525 ii = 526 ii = 527 ii = 528 ii = 529 ii = 530 ii = 531 ii = 532 ii = 533 ii = 534 ii = 535 ii = 536 ii = 537 ii = 538 ii = 539 ii = 540 ii = 541 ii = 542 ii = 543 ii = 544 ii = 545 ii = 546 ii = 547 ii = 548 ii = 549 ii = 550 ii = 551 ii = 552 ii = 553 ii = 554 ii = 555 ii = 556 ii = 557 ii = 558 ii = 559 ii = 560 ii = 561 ii = 562 ii = 563 ii = 564 ii = 565 ii = 566 ii = 567 ii = 568 ii = 569 ii = 570 ii = 571 ii = 572 ii = 573 ii = 574 ii = 575 ii = 576 ii = 577 ii = 578 ii = 579 ii = 580 ii = 581 ii = 582 ii = 583 ii = 584 ii = 585 ii = 586 ii = 587 ii = 588 ii = 589 ii = 590 ii = 591 ii = 592 ii = 593 ii = 594 ii = 595 ii = 596 ii = 597 ii = 598 ii = 599 ii = 600 ii = 601 ii = 602 ii = 603 ii = 604 ii = 605 ii = 606 ii = 607 ii = 608 ii = 609 ii = 610 ii = 611 ii = 612 ii = 613 ii = 614 ii = 615 ii = 616 ii = 617 ii = 618 ii = 619 ii = 620 ii = 621 ii = 622 ii = 623 ii = 624 ii = 625 ii = 626 ii = 627 ii = 628 ii = 629 ii = 630 ii = 631 ii = 632 ii = 633 ii = 634 ii = 635 ii = 636 ii = 637 ii = 638 ii = 639 ii = 640 ii = 641 ii = 642 ii = 643 ii = 644 ii = 645 ii = 646 ii = 647 ii = 648 ii = 649 ii = 650 ii = 651 ii = 652 ii = 653 ii = 654 ii = 655 ii = 656 ii = 657 ii = 658 ii = 659 ii = 660 ii = 661 ii = 662 ii = 663 ii = 664 ii = 665 ii = 666 ...

2   Pass
list = [ 1 6 2 2 2 7 7 1 7 8 8 10 10 2 10 10]; correct = [5 6 8 7 2 3 4 1]; assert(isequal(findPerfectOrderedDominoes(list),correct))

bool = logical 1 ii = 2 ii = 3 ii = 4 ii = 5 ii = 6 ii = 7 ii = 8 ii = 9 ii = 10 ii = 11 ii = 12 ii = 13 ii = 14 ii = 15 ii = 16 ii = 17 ii = 18 ii = 19 ii = 20 ii = 21 ii = 22 ii = 23 ii = 24 ii = 25 ii = 26 ii = 27 ii = 28 ii = 29 ii = 30 ii = 31 ii = 32 ii = 33 ii = 34 ii = 35 ii = 36 ii = 37 ii = 38 ii = 39 ii = 40 ii = 41 ii = 42 ii = 43 ii = 44 ii = 45 ii = 46 ii = 47 ii = 48 ii = 49 ii = 50 ii = 51 ii = 52 ii = 53 ii = 54 ii = 55 ii = 56 ii = 57 ii = 58 ii = 59 ii = 60 ii = 61 ii = 62 ii = 63 ii = 64 ii = 65 ii = 66 ii = 67 ii = 68 ii = 69 ii = 70 ii = 71 ii = 72 ii = 73 ii = 74 ii = 75 ii = 76 ii = 77 ii = 78 ii = 79 ii = 80 ii = 81 ii = 82 ii = 83 ii = 84 ii = 85 ii = 86 ii = 87 ii = 88 ii = 89 ii = 90 ii = 91 ii = 92 ii = 93 ii = 94 ii = 95 ii = 96 ii = 97 ii = 98 ii = 99 ii = 100 ii = 101 ii = 102 ii = 103 ii = 104 ii = 105 ii = 106 ii = 107 ii = 108 ii = 109 ii = 110 ii = 111 ii = 112 ii = 113 ii = 114 ii = 115 ii = 116 ii = 117 ii = 118 ii = 119 ii = 120 ii = 121 ii = 122 ii = 123 ii = 124 ii = 125 ii = 126 ii = 127 ii = 128 ii = 129 ii = 130 ii = 131 ii = 132 ii = 133 ii = 134 ii = 135 ii = 136 ii = 137 ii = 138 ii = 139 ii = 140 ii = 141 ii = 142 ii = 143 ii = 144 ii = 145 ii = 146 ii = 147 ii = 148 ii = 149 ii = 150 ii = 151 ii = 152 ii = 153 ii = 154 ii = 155 ii = 156 ii = 157 ii = 158 ii = 159 ii = 160 ii = 161 ii = 162 ii = 163 ii = 164 ii = 165 ii = 166 ii = 167 ii = 168 ii = 169 ii = 170 ii = 171 ii = 172 ii = 173 ii = 174 ii = 175 ii = 176 ii = 177 ii = 178 ii = 179 ii = 180 ii = 181 ii = 182 ii = 183 ii = 184 ii = 185 ii = 186 ii = 187 ii = 188 ii = 189 ii = 190 ii = 191 ii = 192 ii = 193 ii = 194 ii = 195 ii = 196 ii = 197 ii = 198 ii = 199 ii = 200 ii = 201 ii = 202 ii = 203 ii = 204 ii = 205 ii = 206 ii = 207 ii = 208 ii = 209 ii = 210 ii = 211 ii = 212 ii = 213 ii = 214 ii = 215 ii = 216 ii = 217 ii = 218 ii = 219 ii = 220 ii = 221 ii = 222 ii = 223 ii = 224 ii = 225 ii = 226 ii = 227 ii = 228 ii = 229 ii = 230 ii = 231 ii = 232 ii = 233 ii = 234 ii = 235 ii = 236 ii = 237 ii = 238 ii = 239 ii = 240 ii = 241 ii = 242 ii = 243 ii = 244 ii = 245 ii = 246 ii = 247 ii = 248 ii = 249 ii = 250 ii = 251 ii = 252 ii = 253 ii = 254 ii = 255 ii = 256 ii = 257 ii = 258 ii = 259 ii = 260 ii = 261 ii = 262 ii = 263 ii = 264 ii = 265 ii = 266 ii = 267 ii = 268 ii = 269 ii = 270 ii = 271 ii = 272 ii = 273 ii = 274 ii = 275 ii = 276 ii = 277 ii = 278 ii = 279 ii = 280 ii = 281 ii = 282 ii = 283 ii = 284 ii = 285 ii = 286 ii = 287 ii = 288 ii = 289 ii = 290 ii = 291 ii = 292 ii = 293 ii = 294 ii = 295 ii = 296 ii = 297 ii = 298 ii = 299 ii = 300 ii = 301 ii = 302 ii = 303 ii = 304 ii = 305 ii = 306 ii = 307 ii = 308 ii = 309 ii = 310 ii = 311 ii = 312 ii = 313 ii = 314 ii = 315 ii = 316 ii = 317 ii = 318 ii = 319 ii = 320 ii = 321 ii = 322 ii = 323 ii = 324 ii = 325 ii = 326 ii = 327 ii = 328 ii = 329 ii = 330 ii = 331 ii = 332 ii = 333 ii = 334 ii = 335 ii = 336 ii = 337 ii = 338 ii = 339 ii = 340 ii = 341 ii = 342 ii = 343 ii = 344 ii = 345 ii = 346 ii = 347 ii = 348 ii = 349 ii = 350 ii = 351 ii = 352 ii = 353 ii = 354 ii = 355 ii = 356 ii = 357 ii = 358 ii = 359 ii = 360 ii = 361 ii = 362 ii = 363 ii = 364 ii = 365 ii = 366 ii = 367 ii = 368 ii = 369 ii = 370 ii = 371 ii = 372 ii = 373 ii = 374 ii = 375 ii = 376 ii = 377 ii = 378 ii = 379 ii = 380 ii = 381 ii = 382 ii = 383 ii = 384 ii = 385 ii = 386 ii = 387 ii = 388 ii = 389 ii = 390 ii = 391 ii = 392 ii = 393 ii = 394 ii = 395 ii = 396 ii = 397 ii = 398 ii = 399 ii = 400 ii = 401 ii = 402 ii = 403 ii = 404 ii = 405 ii = 406 ii = 407 ii = 408 ii = 409 ii = 410 ii = 411 ii = 412 ii = 413 ii = 414 ii = 415 ii = 416 ii = 417 ii = 418 ii = 419 ii = 420 ii = 421 ii = 422 ii = 423 ii = 424 ii = 425 ii = 426 ii = 427 ii = 428 ii = 429 ii = 430 ii = 431 ii = 432 ii = 433 ii = 434 ii = 435 ii = 436 ii = 437 ii = 438 ii = 439 ii = 440 ii = 441 ii = 442 ii = 443 ii = 444 ii = 445 ii = 446 ii = 447 ii = 448 ii = 449 ii = 450 ii = 451 ii = 452 ii = 453 ii = 454 ii = 455 ii = 456 ii = 457 ii = 458 ii = 459 ii = 460 ii = 461 ii = 462 ii = 463 ii = 464 ii = 465 ii = 466 ii = 467 ii = 468 ii = 469 ii = 470 ii = 471 ii = 472 ii = 473 ii = 474 ii = 475 ii = 476 ii = 477 ii = 478 ii = 479 ii = 480 ii = 481 ii = 482 ii = 483 ii = 484 ii = 485 ii = 486 ii = 487 ii = 488 ii = 489 ii = 490 ii = 491 ii = 492 ii = 493 ii = 494 ii = 495 ii = 496 ii = 497 ii = 498 ii = 499 ii = 500 ii = 501 ii = 502 ii = 503 ii = 504 ii = 505 ii = 506 ii = 507 ii = 508 ii = 509 ii = 510 ii = 511 ii = 512 ii = 513 ii = 514 ii = 515 ii = 516 ii = 517 ii = 518 ii = 519 ii = 520 ii = 521 ii = 522 ii = 523 ii = 524 ii = 525 ii = 526 ii = 527 ii = 528 ii = 529 ii = 530 ii = 531 ii = 532 ii = 533 ii = 534 ii = 535 ii = 536 ii = 537 ii = 538 ii = 539 ii = 540 ii = 541 ii = 542 ii = 543 ii = 544 ii = 545 ii = 546 ii = 547 ii = 548 ii = 549 ii = 550 ii = 551 ii = 552 ii = 553 ii = 554 ii = 555 ii = 556 ii = 557 ii = 558 ii = 559 ii = 560 ii = 561 ii = 562 ii = 563 ii = 564 ii = 565 ii = 566 ii = 567 ii = 568 ii = 569 ii = 570 ii = 571 ii = 572 ii = 573 ii = 574 ii = 575 ii = 576 ii = 577 ii = 578 ii = 579 ii = 580 ii = 581 ii = 582 ii = 583 ii = 584 ii = 585 ii = 586 ii = 587 ii = 588 ii = 589 ii = 590 ii = 591 ii = 592 ii = 593 ii = 594 ii = 595 ii = 596 ii = 597 ii = 598 ii = 599 ii = 600 ii = 601 ii = 602 ii = 603 ii = 604 ii = 605 ii = 606 ii = 607 ii = 608 ii = 609 ii = 610 ii = 611 ii = 612 ii = 613 ii = 614 ii = 615 ii = 616 ii = 617 ii = 618 ii = 619 ii = 620 ii = 621 ii = 622 ii = 623 ii = 624 ii = 625 ii = 626 ii = 627 ii = 628 ii = 629 ii = 630 ii = 631 ii = 632 ii = 633 ii = 634 ii = 635 ii = 636 ii = 637 ii = 638 ii = 639 ii = 640 ii = 641 ii = 642 ii = 643 ii = 644 ii = 645 ii = 646 ii = 647 ii = 648 ii = 649 ii = 650 ii = 651 ii = 652 ii = 653 ii = 654 ii = 655 ii = 656 ii = 657 ii = 658 ii = 659 ii = 660 ii = 661 ii = 662 ii = 663 ii = 664 ii = 665 ii = 666 ...

3   Pass
list = [1 1 1 7 2 4 4 6 5 1 6 2 7 4 7 5]; correct = [8 5 1 2 7 4 6 3]; assert(isequal(findPerfectOrderedDominoes(list),correct))

bool = logical 1 ii = 2 ii = 3 ii = 4 ii = 5 ii = 6 ii = 7 ii = 8 ii = 9 ii = 10 ii = 11 ii = 12 ii = 13 ii = 14 ii = 15 ii = 16 ii = 17 ii = 18 ii = 19 ii = 20 ii = 21 ii = 22 ii = 23 ii = 24 ii = 25 ii = 26 ii = 27 ii = 28 ii = 29 ii = 30 ii = 31 ii = 32 ii = 33 ii = 34 ii = 35 ii = 36 ii = 37 ii = 38 ii = 39 ii = 40 ii = 41 ii = 42 ii = 43 ii = 44 ii = 45 ii = 46 ii = 47 ii = 48 ii = 49 ii = 50 ii = 51 ii = 52 ii = 53 ii = 54 ii = 55 ii = 56 ii = 57 ii = 58 ii = 59 ii = 60 ii = 61 ii = 62 ii = 63 ii = 64 ii = 65 ii = 66 ii = 67 ii = 68 ii = 69 ii = 70 ii = 71 ii = 72 ii = 73 ii = 74 ii = 75 ii = 76 ii = 77 ii = 78 ii = 79 ii = 80 ii = 81 ii = 82 ii = 83 ii = 84 ii = 85 ii = 86 ii = 87 ii = 88 ii = 89 ii = 90 ii = 91 ii = 92 ii = 93 ii = 94 ii = 95 ii = 96 ii = 97 ii = 98 ii = 99 ii = 100 ii = 101 ii = 102 ii = 103 ii = 104 ii = 105 ii = 106 ii = 107 ii = 108 ii = 109 ii = 110 ii = 111 ii = 112 ii = 113 ii = 114 ii = 115 ii = 116 ii = 117 ii = 118 ii = 119 ii = 120 ii = 121 ii = 122 ii = 123 ii = 124 ii = 125 ii = 126 ii = 127 ii = 128 ii = 129 ii = 130 ii = 131 ii = 132 ii = 133 ii = 134 ii = 135 ii = 136 ii = 137 ii = 138 ii = 139 ii = 140 ii = 141 ii = 142 ii = 143 ii = 144 ii = 145 ii = 146 ii = 147 ii = 148 ii = 149 ii = 150 ii = 151 ii = 152 ii = 153 ii = 154 ii = 155 ii = 156 ii = 157 ii = 158 ii = 159 ii = 160 ii = 161 ii = 162 ii = 163 ii = 164 ii = 165 ii = 166 ii = 167 ii = 168 ii = 169 ii = 170 ii = 171 ii = 172 ii = 173 ii = 174 ii = 175 ii = 176 ii = 177 ii = 178 ii = 179 ii = 180 ii = 181 ii = 182 ii = 183 ii = 184 ii = 185 ii = 186 ii = 187 ii = 188 ii = 189 ii = 190 ii = 191 ii = 192 ii = 193 ii = 194 ii = 195 ii = 196 ii = 197 ii = 198 ii = 199 ii = 200 ii = 201 ii = 202 ii = 203 ii = 204 ii = 205 ii = 206 ii = 207 ii = 208 ii = 209 ii = 210 ii = 211 ii = 212 ii = 213 ii = 214 ii = 215 ii = 216 ii = 217 ii = 218 ii = 219 ii = 220 ii = 221 ii = 222 ii = 223 ii = 224 ii = 225 ii = 226 ii = 227 ii = 228 ii = 229 ii = 230 ii = 231 ii = 232 ii = 233 ii = 234 ii = 235 ii = 236 ii = 237 ii = 238 ii = 239 ii = 240 ii = 241 ii = 242 ii = 243 ii = 244 ii = 245 ii = 246 ii = 247 ii = 248 ii = 249 ii = 250 ii = 251 ii = 252 ii = 253 ii = 254 ii = 255 ii = 256 ii = 257 ii = 258 ii = 259 ii = 260 ii = 261 ii = 262 ii = 263 ii = 264 ii = 265 ii = 266 ii = 267 ii = 268 ii = 269 ii = 270 ii = 271 ii = 272 ii = 273 ii = 274 ii = 275 ii = 276 ii = 277 ii = 278 ii = 279 ii = 280 ii = 281 ii = 282 ii = 283 ii = 284 ii = 285 ii = 286 ii = 287 ii = 288 ii = 289 ii = 290 ii = 291 ii = 292 ii = 293 ii = 294 ii = 295 ii = 296 ii = 297 ii = 298 ii = 299 ii = 300 ii = 301 ii = 302 ii = 303 ii = 304 ii = 305 ii = 306 ii = 307 ii = 308 ii = 309 ii = 310 ii = 311 ii = 312 ii = 313 ii = 314 ii = 315 ii = 316 ii = 317 ii = 318 ii = 319 ii = 320 ii = 321 ii = 322 ii = 323 ii = 324 ii = 325 ii = 326 ii = 327 ii = 328 ii = 329 ii = 330 ii = 331 ii = 332 ii = 333 ii = 334 ii = 335 ii = 336 ii = 337 ii = 338 ii = 339 ii = 340 ii = 341 ii = 342 ii = 343 ii = 344 ii = 345 ii = 346 ii = 347 ii = 348 ii = 349 ii = 350 ii = 351 ii = 352 ii = 353 ii = 354 ii = 355 ii = 356 ii = 357 ii = 358 ii = 359 ii = 360 ii = 361 ii = 362 ii = 363 ii = 364 ii = 365 ii = 366 ii = 367 ii = 368 ii = 369 ii = 370 ii = 371 ii = 372 ii = 373 ii = 374 ii = 375 ii = 376 ii = 377 ii = 378 ii = 379 ii = 380 ii = 381 ii = 382 ii = 383 ii = 384 ii = 385 ii = 386 ii = 387 ii = 388 ii = 389 ii = 390 ii = 391 ii = 392 ii = 393 ii = 394 ii = 395 ii = 396 ii = 397 ii = 398 ii = 399 ii = 400 ii = 401 ii = 402 ii = 403 ii = 404 ii = 405 ii = 406 ii = 407 ii = 408 ii = 409 ii = 410 ii = 411 ii = 412 ii = 413 ii = 414 ii = 415 ii = 416 ii = 417 ii = 418 ii = 419 ii = 420 ii = 421 ii = 422 ii = 423 ii = 424 ii = 425 ii = 426 ii = 427 ii = 428 ii = 429 ii = 430 ii = 431 ii = 432 ii = 433 ii = 434 ii = 435 ii = 436 ii = 437 ii = 438 ii = 439 ii = 440 ii = 441 ii = 442 ii = 443 ii = 444 ii = 445 ii = 446 ii = 447 ii = 448 ii = 449 ii = 450 ii = 451 ii = 452 ii = 453 ii = 454 ii = 455 ii = 456 ii = 457 ii = 458 ii = 459 ii = 460 ii = 461 ii = 462 ii = 463 ii = 464 ii = 465 ii = 466 ii = 467 ii = 468 ii = 469 ii = 470 ii = 471 ii = 472 ii = 473 ii = 474 ii = 475 ii = 476 ii = 477 ii = 478 ii = 479 ii = 480 ii = 481 ii = 482 ii = 483 ii = 484 ii = 485 ii = 486 ii = 487 ii = 488 ii = 489 ii = 490 ii = 491 ii = 492 ii = 493 ii = 494 ii = 495 ii = 496 ii = 497 ii = 498 ii = 499 ii = 500 ii = 501 ii = 502 ii = 503 ii = 504 ii = 505 ii = 506 ii = 507 ii = 508 ii = 509 ii = 510 ii = 511 ii = 512 ii = 513 ii = 514 ii = 515 ii = 516 ii = 517 ii = 518 ii = 519 ii = 520 ii = 521 ii = 522 ii = 523 ii = 524 ii = 525 ii = 526 ii = 527 ii = 528 ii = 529 ii = 530 ii = 531 ii = 532 ii = 533 ii = 534 ii = 535 ii = 536 ii = 537 ii = 538 ii = 539 ii = 540 ii = 541 ii = 542 ii = 543 ii = 544 ii = 545 ii = 546 ii = 547 ii = 548 ii = 549 ii = 550 ii = 551 ii = 552 ii = 553 ii = 554 ii = 555 ii = 556 ii = 557 ii = 558 ii = 559 ii = 560 ii = 561 ii = 562 ii = 563 ii = 564 ii = 565 ii = 566 ii = 567 ii = 568 ii = 569 ii = 570 ii = 571 ii = 572 ii = 573 ii = 574 ii = 575 ii = 576 ii = 577 ii = 578 ii = 579 ii = 580 ii = 581 ii = 582 ii = 583 ii = 584 ii = 585 ii = 586 ii = 587 ii = 588 ii = 589 ii = 590 ii = 591 ii = 592 ii = 593 ii = 594 ii = 595 ii = 596 ii = 597 ii = 598 ii = 599 ii = 600 ii = 601 ii = 602 ii = 603 ii = 604 ii = 605 ii = 606 ii = 607 ii = 608 ii = 609 ii = 610 ii = 611 ii = 612 ii = 613 ii = 614 ii = 615 ii = 616 ii = 617 ii = 618 ii = 619 ii = 620 ii = 621 ii = 622 ii = 623 ii = 624 ii = 625 ii = 626 ii = 627 ii = 628 ii = 629 ii = 630 ii = 631 ii = 632 ii = 633 ii = 634 ii = 635 ii = 636 ii = 637 ii = 638 ii = 639 ii = 640 ii = 641 ii = 642 ii = 643 ii = 644 ii = 645 ii = 646 ii = 647 ii = 648 ii = 649 ii = 650 ii = 651 ii = 652 ii = 653 ii = 654 ii = 655 ii = 656 ii = 657 ii = 658 ii = 659 ii = 660 ii = 661 ii = 662 ii = 663 ii = 664 ii = 665 ii = 666 ...

4   Pass
list = [1 10 3 10 5 3 6 9 7 6 8 7 8 8 9 1 10 5]; correct = [7 6 5 4 8 1 9 3 2]; assert(isequal(findPerfectOrderedDominoes(list),correct))

bool = logical 1 ii = 2 ii = 3 ii = 4 ii = 5 ii = 6 ii = 7 ii = 8 ii = 9 ii = 10 ii = 11 ii = 12 ii = 13 ii = 14 ii = 15 ii = 16 ii = 17 ii = 18 ii = 19 ii = 20 ii = 21 ii = 22 ii = 23 ii = 24 ii = 25 ii = 26 ii = 27 ii = 28 ii = 29 ii = 30 ii = 31 ii = 32 ii = 33 ii = 34 ii = 35 ii = 36 ii = 37 ii = 38 ii = 39 ii = 40 ii = 41 ii = 42 ii = 43 ii = 44 ii = 45 ii = 46 ii = 47 ii = 48 ii = 49 ii = 50 ii = 51 ii = 52 ii = 53 ii = 54 ii = 55 ii = 56 ii = 57 ii = 58 ii = 59 ii = 60 ii = 61 ii = 62 ii = 63 ii = 64 ii = 65 ii = 66 ii = 67 ii = 68 ii = 69 ii = 70 ii = 71 ii = 72 ii = 73 ii = 74 ii = 75 ii = 76 ii = 77 ii = 78 ii = 79 ii = 80 ii = 81 ii = 82 ii = 83 ii = 84 ii = 85 ii = 86 ii = 87 ii = 88 ii = 89 ii = 90 ii = 91 ii = 92 ii = 93 ii = 94 ii = 95 ii = 96 ii = 97 ii = 98 ii = 99 ii = 100 ii = 101 ii = 102 ii = 103 ii = 104 ii = 105 ii = 106 ii = 107 ii = 108 ii = 109 ii = 110 ii = 111 ii = 112 ii = 113 ii = 114 ii = 115 ii = 116 ii = 117 ii = 118 ii = 119 ii = 120 ii = 121 ii = 122 ii = 123 ii = 124 ii = 125 ii = 126 ii = 127 ii = 128 ii = 129 ii = 130 ii = 131 ii = 132 ii = 133 ii = 134 ii = 135 ii = 136 ii = 137 ii = 138 ii = 139 ii = 140 ii = 141 ii = 142 ii = 143 ii = 144 ii = 145 ii = 146 ii = 147 ii = 148 ii = 149 ii = 150 ii = 151 ii = 152 ii = 153 ii = 154 ii = 155 ii = 156 ii = 157 ii = 158 ii = 159 ii = 160 ii = 161 ii = 162 ii = 163 ii = 164 ii = 165 ii = 166 ii = 167 ii = 168 ii = 169 ii = 170 ii = 171 ii = 172 ii = 173 ii = 174 ii = 175 ii = 176 ii = 177 ii = 178 ii = 179 ii = 180 ii = 181 ii = 182 ii = 183 ii = 184 ii = 185 ii = 186 ii = 187 ii = 188 ii = 189 ii = 190 ii = 191 ii = 192 ii = 193 ii = 194 ii = 195 ii = 196 ii = 197 ii = 198 ii = 199 ii = 200 ii = 201 ii = 202 ii = 203 ii = 204 ii = 205 ii = 206 ii = 207 ii = 208 ii = 209 ii = 210 ii = 211 ii = 212 ii = 213 ii = 214 ii = 215 ii = 216 ii = 217 ii = 218 ii = 219 ii = 220 ii = 221 ii = 222 ii = 223 ii = 224 ii = 225 ii = 226 ii = 227 ii = 228 ii = 229 ii = 230 ii = 231 ii = 232 ii = 233 ii = 234 ii = 235 ii = 236 ii = 237 ii = 238 ii = 239 ii = 240 ii = 241 ii = 242 ii = 243 ii = 244 ii = 245 ii = 246 ii = 247 ii = 248 ii = 249 ii = 250 ii = 251 ii = 252 ii = 253 ii = 254 ii = 255 ii = 256 ii = 257 ii = 258 ii = 259 ii = 260 ii = 261 ii = 262 ii = 263 ii = 264 ii = 265 ii = 266 ii = 267 ii = 268 ii = 269 ii = 270 ii = 271 ii = 272 ii = 273 ii = 274 ii = 275 ii = 276 ii = 277 ii = 278 ii = 279 ii = 280 ii = 281 ii = 282 ii = 283 ii = 284 ii = 285 ii = 286 ii = 287 ii = 288 ii = 289 ii = 290 ii = 291 ii = 292 ii = 293 ii = 294 ii = 295 ii = 296 ii = 297 ii = 298 ii = 299 ii = 300 ii = 301 ii = 302 ii = 303 ii = 304 ii = 305 ii = 306 ii = 307 ii = 308 ii = 309 ii = 310 ii = 311 ii = 312 ii = 313 ii = 314 ii = 315 ii = 316 ii = 317 ii = 318 ii = 319 ii = 320 ii = 321 ii = 322 ii = 323 ii = 324 ii = 325 ii = 326 ii = 327 ii = 328 ii = 329 ii = 330 ii = 331 ii = 332 ii = 333 ii = 334 ii = 335 ii = 336 ii = 337 ii = 338 ii = 339 ii = 340 ii = 341 ii = 342 ii = 343 ii = 344 ii = 345 ii = 346 ii = 347 ii = 348 ii = 349 ii = 350 ii = 351 ii = 352 ii = 353 ii = 354 ii = 355 ii = 356 ii = 357 ii = 358 ii = 359 ii = 360 ii = 361 ii = 362 ii = 363 ii = 364 ii = 365 ii = 366 ii = 367 ii = 368 ii = 369 ii = 370 ii = 371 ii = 372 ii = 373 ii = 374 ii = 375 ii = 376 ii = 377 ii = 378 ii = 379 ii = 380 ii = 381 ii = 382 ii = 383 ii = 384 ii = 385 ii = 386 ii = 387 ii = 388 ii = 389 ii = 390 ii = 391 ii = 392 ii = 393 ii = 394 ii = 395 ii = 396 ii = 397 ii = 398 ii = 399 ii = 400 ii = 401 ii = 402 ii = 403 ii = 404 ii = 405 ii = 406 ii = 407 ii = 408 ii = 409 ii = 410 ii = 411 ii = 412 ii = 413 ii = 414 ii = 415 ii = 416 ii = 417 ii = 418 ii = 419 ii = 420 ii = 421 ii = 422 ii = 423 ii = 424 ii = 425 ii = 426 ii = 427 ii = 428 ii = 429 ii = 430 ii = 431 ii = 432 ii = 433 ii = 434 ii = 435 ii = 436 ii = 437 ii = 438 ii = 439 ii = 440 ii = 441 ii = 442 ii = 443 ii = 444 ii = 445 ii = 446 ii = 447 ii = 448 ii = 449 ii = 450 ii = 451 ii = 452 ii = 453 ii = 454 ii = 455 ii = 456 ii = 457 ii = 458 ii = 459 ii = 460 ii = 461 ii = 462 ii = 463 ii = 464 ii = 465 ii = 466 ii = 467 ii = 468 ii = 469 ii = 470 ii = 471 ii = 472 ii = 473 ii = 474 ii = 475 ii = 476 ii = 477 ii = 478 ii = 479 ii = 480 ii = 481 ii = 482 ii = 483 ii = 484 ii = 485 ii = 486 ii = 487 ii = 488 ii = 489 ii = 490 ii = 491 ii = 492 ii = 493 ii = 494 ii = 495 ii = 496 ii = 497 ii = 498 ii = 499 ii = 500 ii = 501 ii = 502 ii = 503 ii = 504 ii = 505 ii = 506 ii = 507 ii = 508 ii = 509 ii = 510 ii = 511 ii = 512 ii = 513 ii = 514 ii = 515 ii = 516 ii = 517 ii = 518 ii = 519 ii = 520 ii = 521 ii = 522 ii = 523 ii = 524 ii = 525 ii = 526 ii = 527 ii = 528 ii = 529 ii = 530 ii = 531 ii = 532 ii = 533 ii = 534 ii = 535 ii = 536 ii = 537 ii = 538 ii = 539 ii = 540 ii = 541 ii = 542 ii = 543 ii = 544 ii = 545 ii = 546 ii = 547 ii = 548 ii = 549 ii = 550 ii = 551 ii = 552 ii = 553 ii = 554 ii = 555 ii = 556 ii = 557 ii = 558 ii = 559 ii = 560 ii = 561 ii = 562 ii = 563 ii = 564 ii = 565 ii = 566 ii = 567 ii = 568 ii = 569 ii = 570 ii = 571 ii = 572 ii = 573 ii = 574 ii = 575 ii = 576 ii = 577 ii = 578 ii = 579 ii = 580 ii = 581 ii = 582 ii = 583 ii = 584 ii = 585 ii = 586 ii = 587 ii = 588 ii = 589 ii = 590 ii = 591 ii = 592 ii = 593 ii = 594 ii = 595 ii = 596 ii = 597 ii = 598 ii = 599 ii = 600 ii = 601 ii = 602 ii = 603 ii = 604 ii = 605 ii = 606 ii = 607 ii = 608 ii = 609 ii = 610 ii = 611 ii = 612 ii = 613 ii = 614 ii = 615 ii = 616 ii = 617 ii = 618 ii = 619 ii = 620 ii = 621 ii = 622 ii = 623 ii = 624 ii = 625 ii = 626 ii = 627 ii = 628 ii = 629 ii = 630 ii = 631 ii = 632 ii = 633 ii = 634 ii = 635 ii = 636 ii = 637 ii = 638 ii = 639 ii = 640 ii = 641 ii = 642 ii = 643 ii = 644 ii = 645 ii = 646 ii = 647 ii = 648 ii = 649 ii = 650 ii = 651 ii = 652 ii = 653 ii = 654 ii = 655 ii = 656 ii = 657 ii = 658 ii = 659 ii = 660 ii = 661 ii = 662 ii = 663 ii = 664 ii = 665 ii = 666 ...