[Solved] Determine if a number can be made with prepicked numbers and times


This is what I used to finish my project.

 public static bool Validate(int amount, int[] total, int[] needed)
    {
        int[] billCount = total;
        int[] cash = { 100, 50, 20, 10, 5, 1 };
        int total = amount;
        bool isValid = true;
        for (int i = 0; i < total.Length; i++)
        {
            if(total >= cash[i])
            {
                billCount[i] = billCount[i] - needed[i];
            }
            if(billCount[i] < 0)
            {
                isValid = false;
                break;
            }
        }
        return isValid;
    }

solved Determine if a number can be made with prepicked numbers and times