Google-Developer-Student-Club-CCOEW / Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE

Welcome to the Hacktoberfest 2023 Competitive-Programming Cohort for Cummins College and MMCOE students! To request issue assignment, create a pull request, providing: 1. Full Name šŸ§‘ā€šŸŽ“ 2.Email šŸ“§ 3.College ID (RNO) šŸ”¢ 4.Branch of Study.šŸ“š 5. Year šŸ“† .The Cummins College and MMCOE students' PRs will be considered only. Thank you!
9 stars 69 forks source link

Sliding Cost #147

Open suryaprakashpandey opened 9 months ago

suryaprakashpandey commented 9 months ago

Write code in the preferred language and attach output with it.

You are given an array of n integers. Your task is to calculate for each window of k elements, from left to right, the minimum total cost of making all elements equal.

You can increase or decrease each element with cost x where x is the difference between the new and the original value. The total cost is the sum of such costs.

Input The first input line contains two integers n and k: the number of elements and the size of the window.

Then there are n integers x1,x2,ā€¦,xn: the contents of the array.

Output Output nāˆ’k+1 values: the costs.

Example:

Input: 8 3 2 4 3 5 8 1 2 1 Output: 2 2 5 7 7 1

RishabhDhawad commented 8 months ago

I would like to contribute to this, please assign this to me.

anulon commented 8 months ago

Can u please assign this issue to me . Anushka Lonkar TY Comp Cummins

vaishnavim141003 commented 8 months ago

I would like to work on this issue using python language -Vaishnavi Mahajan. Cummins college of engineering.(SY) Can you please assign this issue to me .

vaishnavim141003 commented 8 months ago

Issue resolved #147 https://github.com/Google-Developer-Student-Club-CCOEW/Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE/issues/147

On Sat, 21 Oct 2023 at 17:41, GDSC Cummins X MMCOE @.***> wrote:

Assigned #147 https://github.com/Google-Developer-Student-Club-CCOEW/Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE/issues/147 to @vaishnavim141003 https://github.com/vaishnavim141003.

ā€” Reply to this email directly, view it on GitHub https://github.com/Google-Developer-Student-Club-CCOEW/Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE/issues/147#event-10731201252, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2TPB6U6N4Q5265K5RSS3EDYAO3WZAVCNFSM6AAAAAA5QIXI6OVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQG4ZTCMRQGEZDKMQ . You are receiving this because you were assigned.Message ID: <Google-Developer-Student-Club-CCOEW/Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE/issue/147/issue_event/10731201252 @github.com>