From 0c38269333237caaee7dbeba3a7b9c47ef261850 Mon Sep 17 00:00:00 2001 From: Lam Haoyin Date: Sun, 16 Jan 2022 10:41:18 +0800 Subject: [PATCH] add: description --- 2201/220116.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/2201/220116.cpp b/2201/220116.cpp index 8b140e1..83029c8 100644 --- a/2201/220116.cpp +++ b/2201/220116.cpp @@ -1,6 +1,14 @@ #include #include +/** + * 849. Maximize Distance to Closest Person + * You are 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. + */ + class Solution { public: static int maxDistToClosest(const std::vector& seats) {