Discrete least squares method for the solution of the schrödinger equation; Application to the nuclear three-body problem