Company: Amazon_30oct
Difficulty: medium
Smart Cities Security Units Relocation Problem Description In Amazon's Smart Cities Management System, each city has a given population and some cities are equipped with security units. The problem involves two main inputs: An integer array population of size n , where population[i] is the number of inhabitants in the i th city. A binary string unit of length n , where unit[i] == '1' means city i has a security unit, and '0' means it does not. Relocation Rule: A security unit at city i (where i > 1 ) can be moved one step to the left to city i - 1 . Each unit can be moved at most once. If moved, city i loses its unit and city i - 1 gains one. City 1 security unit cannot be moved further left. A city is protected if it has a security unit after all relocations. Determine the maximum population that can be protected by optimally relocating the security units. Note: The problem uses 1-based indexing, meaning city indices, the population array, and the unit binary string all start from 1 a