Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
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.
...
More Amazon interview questions
- Find Minimum City Hopsmedium
- [CodeSignal] Drone Hub Travelmedium
- [CodeSignal] Minimum Security Groupsmedium
- [CodeSignal] Maximum Product Ratinghard
- [CodeSignal] Permutation Sorterhard
- [CodeSignal] Warehouse Emergency Deliverieshard
- [CodeSignal] Maximum Secure Deliveriesmedium
- Binary Tree Camerashard
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.