Ge·Software Engineer·Technical Phone Screen
- Given an M x N binary grid where 1s represent demand locations, find the single cell to place a store such that the total Manhattan distance to all demand cells is minimized. Return that minimum total distance.
- Given a string of Y and N characters representing customer arrivals by hour, find the earliest closing time t in [0, n] that minimizes the penalty, where staying open during an N hour or closing during a Y hour each cost 1.
“I jumped straight into brute force, iterating every cell and summing distances to all 1s.”