Given the following sample output, implement a java code that solves the knapsack problem by using the exhaustive search brute-force algorithm. Use the array list for storing the subset of the optimal solution. Note that the weight and value of each item are randomly generated in the range of 1 to 50.
![Given the following sample output implement a java code that solves the knapsack problem by using the exhaustive search bruteforce algorithm Use the array list class=](https://us-static.z-dn.net/files/d4d/624436543953cdd55fb5e32d8ef94de0.png)