CT56078

Rhys's Smoky Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the honey farms of Buzzwell pays by the answer, and Rhys intends to earn it. First: the full register of stretches. 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 <= 3569; -1000000 <= a[i] <= 1000.

Example 1:

Input: 839 774 -689804 -929721 -370341 -795394 -625577 -903020 -855310 -531705 -137343 -852897 -6321 -675789 -233295 -304437 -360931 -893470 -527090 -903305 -667912 -750802 -924844 -525094 -126009 -145908 -526070 -671367 -122601 -902596 -778507 -9822 -9812 -278151 -842404 -721536 -597642 -30172 -771915 -784554 -332691 -881437 -877324 -346259 -559593 -861331 -966299 -73667 -824642 -507192 -235888 -880156 -488554 -194544 -938965 -798337 -464695 -175061 -180855 -126688 -11118 -786821 -907900 -605474 -201308 -663806 -371707 -226843 -858019 -665393 -14175 -242349 -436792 -619462 -867254 -849148 -258373 -408799 -632793 -62407 -236420 -138261 -758582 -106223 -586652 -335785 -410802 -405646 -358101 -761018 -196014 -60872 -428564 -618303 -162336 -385948 -113175 -803227 -493058 -40783 -21023 -460623 -49657…
Output: -393322207

Example 2:

Input: 1610 1170 -316420 -757946 -854475 -247598 -45254 -518530 -478656 -250117 -302462 -97 -746126 -131349 -635401 -53955 -349439 -210630 -118449 -221561 -361420 -185132 -887925 -916343 -716951 -820835 -910815 -895415 -800081 -711267 -364236 -727921 -52689 -794174 -349196 -813338 -693047 -793646 -457521 -648158 -497787 -91506 -734114 -663138 -610902 -926317 -18642 -753456 -460767 -848431 -101207 -963604 -364030 -301245 -918525 -438708 -644541 -267141 -385804 -879822 -773607 -851195 -215205 -812370 -72635 -975613 -726121 -714346 -51062 -949755 -962010 -156034 -724163 -441465 -357714 -264516 -457062 -217853 -942928 -317987 -664311 -208143 -635587 -720833 -905503 -518655 -262414 -187975 -173860 -923867 -213393 -870598 -138047 -370512 -860223 -975132 -415227 -865498 -55988 -250064 -542446 -258525 -8…
Output: -604015995

Example 3:

Input: 3241 1687 -824361 -151479 -282548 -464877 -768508 -582126 -629319 -20219 -123188 -405024 -330799 -305770 -498982 -111016 -830376 -274496 -489937 -834140 -746809 -590055 -773504 -825020 -291013 -180989 -825247 -326125 -13667 -741114 -673101 -77236 -789144 -394244 -357893 -951100 -954815 -460716 -744755 -246992 -963916 -316504 -497225 -917691 -345856 -431287 -435057 -679221 -177839 -807587 -968276 -274195 -683955 -688153 -138900 -345261 -110387 -177031 -158843 -580298 -420519 -467986 -82867 -680992 -627620 -14476 -442164 -789554 -473198 -552201 -606995 -482340 -643041 -327640 -769418 -368033 -680648 -940690 -956046 -584321 -932583 -73357 -589348 -388744 -991847 -861712 -204690 -481130 -389557 -518204 -849796 -488146 -454241 -804520 -875297 -733012 -952515 -850039 -620322 -418419 -770351 -262…
Output: -859260317

Constraints:

1 <= k <= n <= 3569; -1000000 <= a[i] <= 1000.

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