Google·Software Engineer·Onsite - Coding / Algorithms
- You have an array of link weights representing a golden chain. Remove exactly one link, reconnect the two remaining segments into a single chain, then make one cut to split it into two pieces of equal total weight. Return true if any valid removal index exists, false otherwise. Follow-up: return all valid (removal index, cut position) pairs.
“The base case clicked pretty fast once I realized removing a link and reconnecting is just prefix sums on the modified array.”