GDSC-IGDTUW-Autumn-of-Code-2022 / ip-questions-2023

INTERVIEW PRACTICE
0 stars 5 forks source link

Aggressive cows #3

Open Khxshx opened 1 year ago

Khxshx commented 1 year ago

Given an array of length ‘N’, where each element denotes the position of a stall. Now you have ‘N’ stalls and an integer ‘K’ which denotes the number of cows that are aggressive. To prevent the cows from hurting each other, you need to assign the cows to the stalls, such that the minimum distance between any two of them is as large as possible. Return the largest minimum distance. 7ae5c21f-0f67-4fc2-93f9-d14ddb58c390_1624870922 4469664

Example :

array: 1,2,4,8,9 & k=3 O/P: 3 Explaination: 1st cow at stall 1 , 2nd cow at stall 4 and 3rd cow at stall 8

Nitya-Pasrija commented 1 year ago

Hey @Parul-Mann @Khxshx Can you assign this to me?

Harshita05104 commented 1 year ago

@Parul-Mann @Khxshx Assign this issue to me.

BhavyaDevani commented 1 year ago

@Khxshx pls assign this issue to me