</>OfferRetriever
DashboardDiscuss
NEW

Summer Sale

Limited Time Deal: Unlock all premium questions for over 30% off

$10.42$7.08

14

:

02

:

49

:

47

Get this deal
Back to Dashboard

OA [CodeSignal] Maximum Protected City Population

Medium

You are given an integer array population and a binary string protection of the same length. A city at index i is currently protected if protection[i] == '0' and unprotected if protection[i] == '1'.

You may optionally shift any protected city's marker one position to the left (i.e., shift a '0' one index earlier in the string). Each protection marker can be shifted at most once, and two markers cannot occupy the same position after shifting. ...

OfferRetriever

Master technical interviews with real questions from top companies. Build your confidence and career.

PRODUCT
PricingDashboardDiscussOfferRetriever vs LeetCode
LEGAL
POPULAR COMPANIES
GoogleMetaAmazonMicrosoftNetflixStripeUberTikTokBrowse all companies →

© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.