I need the help of JavaScript master 20

There are 123456789 nine numbers, each number can only be filled once, there are 3×3 grids, and the sum of each row, each vertical row and each oblique row is equal to 15. The answer is this:

294

753

618

How to use JavaScript code to solve this problem (if you don’t know the answer), avaScript code I need

I happen to have written a typical knapsack algorithm. Do you think it can be used?

http://yuanzm.github.io/backpack-calculator/

After processing the results, you should be able to get the results you want.