Updated the solutionsFromOpCombs function from recursive to using a fold.