Google·Software Engineer·Onsite - Coding / Algorithms
- You're given an array representing the link weights of a gold chain. Remove exactly one link, reconnect the remaining links into a chain, then check if you can make a single cut that splits the chain into two pieces of equal total weight. Return true if any valid (remove, cut) pair exists. Follow-up: return all such pairs.
“My first instinct was prefix sums, which was right, but I kept fumbling the boundary conditions.”