CT51510

Milo's Woven Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Milo the assayer watches over the honey farms of Buzzwell's stores of panels. A careful computation stands between order and chaos. 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 <= 3661; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 1128 13 911060386 927458055 101665662 287310518 906303453 379711088 401923197 99008115 142103714 353480692 608013737 653415543 405567860 652629998 32907963 242155090 414699105 588149886 144027004 251939809 48047003 912760880 910345226 55955312 562410375 751853484 131659915 470453662 220147516 502236985 654068118 836441638 10935682 953399587 96675848 822522361 619206983 110364216 721620852 833089160 857240583 602930808 368597483 869658936 847626266 39056584 53385453 431598771 795237490 521359681 906376287 216454439 104043491 826835883 342143636 638284342 830706547 603102148 10644936 668387712 277879154 722040552 420711135 938545616 587571366 651281163 870218911 957234373 319731090 212991955 508216304 348586150 857151161 634509185 607461034 233566094 260513797 533055380 386724923 654228030 5…
Output: 3523542680

Example 2:

Input: 3214 1533 820936748 451674054 946154401 82037627 202161433 33807075 199623357 955608197 106491925 492733686 159676079 255119135 885640951 448530593 -272191 515268579 283195738 905461524 266398826 885245621 59108169 530418065 463921269 524256912 751359104 899658823 350844301 685635890 580179800 517357135 318353981 529676501 18866324 459331541 634991753 697856562 798810821 99655710 262492349 272888386 871053466 364920959 793991769 22233663 829649150 168634547 294623861 588167831 277435079 219792701 628419743 465107199 64703134 96806748 111656090 858613912 928610370 786663905 801607056 967835918 383969891 208072094 392001617 860973657 923750779 572351023 303974221 981553390 511295884 392053227 508540581 497638082 861484760 346281493 623679738 824102001 830085387 3166752 547316340 482318814 40…
Output: 751207236454

Example 3:

Input: 1876 1744 276621217 798011091 751534089 809717981 865790 254233907 802258287 545993653 290456238 340065664 710243749 310461278 274491714 15947764 205477874 482420265 101531938 779324376 820236082 244377456 525311442 999659946 287345372 706782630 350488215 10927430 450804754 753193332 207933792 541477390 379853939 668810591 346060676 33625553 503287312 4581061 713800230 896182584 784137479 910294044 182319323 5566600 912020104 85877057 966520693 593935144 297252302 801022808 852104905 583598154 510871451 838354209 555628017 142386893 571361943 957597846 700450116 36861977 118199717 537694266 206067072 940389647 255528936 568990154 953475277 394104126 792848168 602406984 575422209 5797417 230053989 993011047 979290868 241790532 94641339 793740113 976230642 368516587 924670009 133724563 39039…
Output: 874233949159

Constraints:

1 <= k <= n <= 3661; -1000000 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Milo's Woven Ledger - MEDIUM Coding Problem | CodeTikki