Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

leetcode problem 849. Maximize Distance to Closest Person. #330

Open
vermaaarti opened this issue Oct 8, 2023 · 1 comment · May be fixed by #393
Open

leetcode problem 849. Maximize Distance to Closest Person. #330

vermaaarti opened this issue Oct 8, 2023 · 1 comment · May be fixed by #393

Comments

@vermaaarti
Copy link

Hey @Saikat2407, I would like to contribute to this problem, Please do assign it to me.

where:
given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat is empty (0-indexed).

There is at least one empty seat, and at least one person sitting.

Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized.

Return that maximum distance to the closest person.

@nikunj441
Copy link

Hey @Saikat2407 , I would like to contribute to this problem, Please do assign it to me.
I am 4 start on codechef and specialist on codeforces.
I have a great command in data structures and algorithms. Will surely, provide you the best optimal solution.

Aloneking789 added a commit to Aloneking789/DSA_Hacktoberfest2023 that referenced this issue Oct 10, 2023
Fixes Saikat2407#330 
The code finds the seat where Alex can sit to maximize the distance from the nearest person in a row of seats, considering seat occupancy (0 and 1).
@Aloneking789 Aloneking789 linked a pull request Oct 10, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants