An algebraic approach to solve a class of combinatorial sums