Algebraic approach to the solution of a one-dimensional model of N interacting particles