Find horizontal cut balancing square areas | Google Interview Question