The strategy used is not well, because it becomes very complex and very difficult to calculate the ways, it would play one by one, that is, despite making sense, the last part of the way to distribute the books how is it obtained? why would it be like this?
There is a much more effective way of solving the problem, and that is to divide it by cases.
Case 1:
Choose four books from the 10 available books and give them to the first student
Then choose three books from the remaining six books and give them to the second student.
Finally, give the remaining three books to the last student
Case 2:
Choose three books from the 10 available books and give them to the first student
Then choose four books from the remaining seven books and give them to the second student.
Finally, give the remaining three books to the last student
Case 3:
Choose three books from the 10 available books and give them to the first student
Then choose three books from the remaining seven books and give them to the second student.
Lastly, give the remaining four books to the last student
First it is to calculate the number number in each case by means of combinations, multiply the options per case and then add the final value in each case.