I am trying to understand how CCA can be formulated as a least-squares
problem in the binary class case. 

I understood how CCA and Least square problem works. But not getting how we can formulate CCA to solve least square problem.