Quote:
anyone can help me
No because the help you want is "Do my HomeWork"
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their
purpose is learning and
practicing.
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
Show your work and explain what is you exact problem.
Quote:
I tried a lot but did not find a solution
Backtracking algorithm is not complicated, it is trial and error.
You start to compose a solution 1 number at the time, when you reach a point where you have no possible number, you have to go back to previous step and try another number.
Backtracking - Wikipedia[
^]