CT38589

Cobbler and the Obsidian scrolls

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the coastal hub of Tidewater, Cobbler the store warden keeps careful count of the scrolls. assign crews to the morning shifts, every figure matters. Task: Print the minimum sum of any contiguous subarray of length exactly k. Input format: First line: n and k. Second line: n integers. Output format: Print the minimum window sum. Constraints: 1 <= k <= n <= 2087; 0 <= a[i] <= 1000.

Example 1:

Input: 2079 1268 27 265 916 482 66 776 179 302 932 535 144 862 400 55 965 988 950 650 444 337 660 811 566 907 832 883 622 533 380 843 460 643 956 17 780 875 735 552 259 390 320 496 132 746 974 811 946 57 133 983 375 857 478 773 955 934 12 220 383 900 422 37 533 702 165 691 832 167 425 414 563 255 840 556 729 66 387 404 596 200 72 302 215 910 798 556 989 616 823 280 479 905 791 748 193 10 398 96 504 650 671 552 489 44 217 125 52 962 173 655 280 318 105 937 517 975 800 812 191 176 425 128 190 797 484 347 874 959 865 59 558 702 45 644 912 513 348 974 855 587 578 491 515 782 56 986 221 208 343 186 574 143 362 327 77 545 229 742 799 445 234 441 990 81 354 79 327 16 920 100 712 64 130 469 781 0 715 447 153 616 878 484 753 251 196 107 227 702 935 875 8 80 692 170 955 860 645 518 168 90 515 958 102 986 2…
Output: 637756

Example 2:

Input: 732 65 440 384 870 499 880 976 140 775 699 749 217 442 981 923 309 384 51 915 978 858 471 356 501 408 721 637 306 524 353 135 272 816 938 208 590 374 992 703 617 799 40 168 622 146 539 179 619 391 344 97 844 703 602 641 649 621 138 82 630 149 915 326 528 889 624 845 440 578 642 921 635 630 480 151 855 478 344 431 460 715 913 674 805 259 169 220 348 65 95 918 385 381 673 130 346 351 267 579 702 346 733 467 125 415 575 962 237 582 15 46 65 133 902 671 399 155 216 689 261 523 494 677 188 38 230 611 952 595 242 58 337 472 467 596 757 747 825 104 10 58 112 44 609 410 421 136 569 152 128 388 686 432 167 219 974 491 848 677 213 58 291 57 92 276 78 551 939 374 88 155 813 658 661 263 435 746 762 284 573 753 738 377 23 427 503 968 868 216 1000 372 654 846 850 52 239 192 327 851 907 764 979 708 164 9…
Output: 24800

Example 3:

Input: 546 483 725 311 610 437 399 990 568 255 194 550 133 321 675 69 791 356 279 447 386 556 330 477 118 308 171 318 588 194 315 857 793 32 488 187 711 912 878 393 668 898 722 252 928 952 821 826 745 815 294 103 846 570 648 941 17 585 316 283 905 256 58 143 975 761 323 518 562 572 938 974 836 356 779 63 583 118 606 956 122 892 355 625 683 665 606 923 22 854 469 256 419 21 201 311 880 817 234 355 886 98 880 199 88 91 620 145 619 751 71 60 628 737 273 951 420 362 792 5 793 586 348 522 907 970 902 789 878 815 465 123 423 468 840 320 825 521 261 796 983 545 961 831 463 264 631 746 905 766 10 152 857 267 483 594 65 50 918 301 440 671 125 865 966 483 802 170 421 74 715 406 30 678 557 497 296 137 881 111 991 157 821 810 188 1 770 460 270 870 198 6 597 303 642 986 427 997 679 447 578 136 856 168 659 743…
Output: 232515

Constraints:

1 <= k <= n <= 2087; 0 <= a[i] <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
Cobbler and the Obsidian scrolls - MEDIUM Coding Problem | CodeTikki