Skip to content

Instantly share code, notes, and snippets.

@bruteforceboy
bruteforceboy / Solution.java
Last active June 11, 2022 15:23
DP Solution to the ATM Problem
import java.util.*;
public class Solution {
public static int[] getMinimumNotesCombination(int targetAmount, int[] notes) {
final int INF = Integer.MAX_VALUE;
int notesCount = notes.length;
int[][] dp = new int[targetAmount + 1][notesCount]; // represents
// a combination of notes with minimum sum that gives you some amount