Problem: Coins

Requirements

  • JDK (v17+);
  • Maven (v3.9.5);

Build

The build process needs maven. In order to do that, use the command below:

mvn clean install

Run

In order to run the demo project, just run the command below after Build:

java -jar target/coins-1.0-SNAPSHOT.jar

Notes

The complexity of this algorithm is so large, because we have 4 for statements. The complexity of this algorithm is O(n^4) and it is not possible to be executed for large numbers.

I know that it could be improved using Dynamic Programming or Recursive Backtracking method to solve that. But based on time to solve the algorithm and questions, I give my best to solve it!