Cody

# Problem 2349. Elements with highest local average

Solution 1999324

Submitted on 2 Nov 2019 by Doan Quang Manh
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
x = [1 2 3 4 5 6 7 8 9]; y_correct = [7 8 9]; assert(isequal(your_fcn_name(x),y_correct))

a = 2 a = 3 y = 2 3 4 a = 4 y = 3 4 5 a = 5 y = 4 5 6 a = 6 y = 5 6 7 a = 7 y = 6 7 8 a = 8 y = 7 8 9

2   Pass
x = [1 2 3]; y_correct = [1 2 3]; assert(isequal(your_fcn_name(x),y_correct))

a = 2

3   Pass
x = [0 0 0]; y_correct = [0 0 0]; assert(isequal(your_fcn_name(x),y_correct))

a = 0

4   Pass
x = [3 3 3 1 1 1 2 3 4]; y_correct = [3 3 3]; assert(isequal(your_fcn_name(x),y_correct))

a = 3 a = 2.3333 a = 1.6667 a = 1 a = 1.3333 a = 2 a = 3

5   Pass
x = 1000:-1:1; y_correct = [1000 999 998]; assert(isequal(your_fcn_name(x),y_correct))

a = 999 a = 998 a = 997 a = 996 a = 995 a = 994 a = 993 a = 992 a = 991 a = 990 a = 989 a = 988 a = 987 a = 986 a = 985 a = 984 a = 983 a = 982 a = 981 a = 980 a = 979 a = 978 a = 977 a = 976 a = 975 a = 974 a = 973 a = 972 a = 971 a = 970 a = 969 a = 968 a = 967 a = 966 a = 965 a = 964 a = 963 a = 962 a = 961 a = 960 a = 959 a = 958 a = 957 a = 956 a = 955 a = 954 a = 953 a = 952 a = 951 a = 950 a = 949 a = 948 a = 947 a = 946 a = 945 a = 944 a = 943 a = 942 a = 941 a = 940 a = 939 a = 938 a = 937 a = 936 a = 935 a = 934 a = 933 a = 932 a = 931 a = 930 a = 929 a = 928 a = 927 a = 926 a = 925 a = 924 a = 923 a = 922 a = 921 a = 920 a = 919 a = 918 a = 917 a = 916 a = 915 a = 914 a = 913 a = 912 a = 911 a = 910 a = 909 a = 908 a = 907 a = 906 a = 905 a = 904 a = 903 a = 902 a = 901 a = 900 a = 899 a = 898 a = 897 a = 896 a = 895 a = 894 a = 893 a = 892 a = 891 a = 890 a = 889 a = 888 a = 887 a = 886 a = 885 a = 884 a = 883 a = 882 a = 881 a = 880 a = 879 a = 878 a = 877 a = 876 a = 875 a = 874 a = 873 a = 872 a = 871 a = 870 a = 869 a = 868 a = 867 a = 866 a = 865 a = 864 a = 863 a = 862 a = 861 a = 860 a = 859 a = 858 a = 857 a = 856 a = 855 a = 854 a = 853 a = 852 a = 851 a = 850 a = 849 a = 848 a = 847 a = 846 a = 845 a = 844 a = 843 a = 842 a = 841 a = 840 a = 839 a = 838 a = 837 a = 836 a = 835 a = 834 a = 833 a = 832 a = 831 a = 830 a = 829 a = 828 a = 827 a = 826 a = 825 a = 824 a = 823 a = 822 a = 821 a = 820 a = 819 a = 818 a = 817 a = 816 a = 815 a = 814 a = 813 a = 812 a = 811 a = 810 a = 809 a = 808 a = 807 a = 806 a = 805 a = 804 a = 803 a = 802 a = 801 a = 800 a = 799 a = 798 a = 797 a = 796 a = 795 a = 794 a = 793 a = 792 a = 791 a = 790 a = 789 a = 788 a = 787 a = 786 a = 785 a = 784 a = 783 a = 782 a = 781 a = 780 a = 779 a = 778 a = 777 a = 776 a = 775 a = 774 a = 773 a = 772 a = 771 a = 770 a = 769 a = 768 a = 767 a = 766 a = 765 a = 764 a = 763 a = 762 a = 761 a = 760 a = 759 a = 758 a = 757 a = 756 a = 755 a = 754 a = 753 a = 752 a = 751 a = 750 a = 749 a = 748 a = 747 a = 746 a = 745 a = 744 a = 743 a = 742 a = 741 a = 740 a = 739 a = 738 a = 737 a = 736 a = 735 a = 734 a = 733 a = 732 a = 731 a = 730 a = 729 a = 728 a = 727 a = 726 a = 725 a = 724 a = 723 a = 722 a = 721 a = 720 a = 719 a = 718 a = 717 a = 716 a = 715 a = 714 a = 713 a = 712 a = 711 a = 710 a = 709 a = 708 a = 707 a = 706 a = 705 a = 704 a = 703 a = 702 a = 701 a = 700 a = 699 a = 698 a = 697 a = 696 a = 695 a = 694 a = 693 a = 692 a = 691 a = 690 a = 689 a = 688 a = 687 a = 686 a = 685 a = 684 a = 683 a = 682 a = 681 a = 680 a = 679 a = 678 a = 677 a = 676 a = 675 a = 674 a = 673 a = 672 a = 671 a = 670 a = 669 a = 668 a = 667 a = 666 a = 665 a = 664 a = 663 a = 662 a = 661 a = 660 a = 659 a = 658 a = 657 a = 656 a = 655 a = 654 a = 653 a = 652 a = 651 a = 650 a = 649 a = 648 a = 647 a = 646 a = 645 a = 644 a = 643 a = 642 a = 641 a = 640 a = 639 a = 638 a = 637 a = 636 a = 635 a = 634 a = 633 a = 632 a = 631 a = 630 a = 629 a = 628 a = 627 a = 626 a = 625 a = 624 a = 623 a = 622 a = 621 a = 620 a = 619 a = 618 a = 617 a = 616 a = 615 a = 614 a = 613 a = 612 a = 611 a = 610 a = 609 a = 608 a = 607 a = 606 a = 605 a = 604 a = 603 a = 602 a = 601 a = 600 a = 599 a = 598 a = 597 a = 596 a = 595 a = 594 a = 593 a = 592 a = 591 a = 590 a = 589 a = 588 a = 587 a = 586 a = 585 a = 584 a = 583 a = 582 a = 581 a = 580 a = 579 a = 578 a = 577 a = 576 a = 575 a = 574 a = 573 a = 572 a = 571 a = 570 a = 569 a = 568 a = 567 a = 566 a = 565 a = 564 a = 563 a = 562 a = 561 a = 560 a = 559 a = 558 a = 557 a = 556 a = 555 a = 554 a = 553 a = 552 a = 551 a = 550 a = 549 a = 548 a = 547 a = 546 a = 545 a = 544 a = 543 a = 542 a = 541 a = 540 a = 539 a = 538 a = 537 a = 536 a = 535 a = 534 a = 533 a = 532 a = 531 a = 530 a = 529 a = 528 a = 527 a = 526 a = 525 a = 524 a = 523 a = 522 a = 521 a = 520 a = 519 a = 518 a = 517 a = 516 a = 515 a = 514 a = 513 a = 512 a = 511 a = 510 a = 509 a = 508 a = 507 a = 506 a = 505 a = 504 a = 503 a = 502 a = 501 a = 500 a = 499 a = 498 a = 497 a = 496 a = 495 a = 494 a = 493 a = 492 a = 491 a = 490 a = 489 a = 488 a = 487 a = 486 a = 485 a = 484 a = 483 a = 482 a = 481 a = 480 a = 479 a = 478 a = 477 a = 476 a = 475 a = 474 a = 473 a = 472 a = 471 a = 470 a = 469 a = 468 a = 467 a = 466 a = 465 a = 464 a = 463 a = 462 a = 461 a = 460 a = 459 a = 458 a = 457 a = 456 a = 455 a = 454 a = 453 a = 452 a = 451 a = 450 a = 449 a = 448 a = 447 a = 446 a = 445 a = 444 a = 443 a = 442 a = 441 a = 440 a = 439 a = 438 a = 437 a = 436 a = 435 a = 434 a = 433 a = 432 a = 431 a = 430 a = 429 a = 428 a = 427 a = 426 a = 425 a = 424 a = 423 a = 422 a = 421 a = 420 a = 419 a = 418 a = 417 a = 416 a = 415 a = 414 a = 413 a = 412 a = 411 a = 410 a = 409 a = 408 a = 407 a = 406 a = 405 a = 404 a = 403 a = 402 a = 401 a = 400 a = 399 a = 398 a = 397 a = 396 a = 395 a = 394 a = 393 a = 392 a = 391 a = 390 a = 389 a = 388 a = 387 a = 386 a = 385 a = 384 a = 383 a = 382 a = 381 a = 380 a = 379 a = 378 a = 377 a = 376 a = 375 a = 374 a = 373 a = 372 a = 371 a = 370 a = 369 a = 368 a = 367 a = 366 a = 365 a = 364 a = 363 a = 362 a = 361 a = 360 a = 359 a = 358 a = 357 a = 356 a = 355 a = 354 a = 353 a = 352 a = 351 a = 350 a = 349 a = 348 a = 347 a = 346 a = 345 a = 344 a = 343 a = 342 a = 341 a = 340 a = 339 a = 338 a = 337 a = 336 a = 335 a = 334 a = 333 a = 332 a = 331 a = 330 a = 329 a = 328 a = 327 a = 326 a = 325 a = 324 a = 323 a = 322 a = 321 a = 320 a = 319 a = 318 a = 317 a = 316 a = 315 a = 314 a = 313 a = 312 a = 311 a = 310 a = 309 a = 308 a = 307 a = 306 a = 305 a = 304 a = 303 a = 302 a = 301 a = 300 a = 299 a = 298 a = 297 a = 296 a = 295 a = 294 a = 293 a = 292 a = 291 a = 290 a = 289 a = 288 a = 287 a = 286 a = ...