For example, lets take this simple recursive code that solves coin problem (can you use given array of coins to add up to num)
bool CoinProblem(int targ, vector<int> &nums)
{
if (targ == 0)
return true;
if(targ < 0)
return false;
for (size_t i = 0; i < size(nums); i++)
{
if(CoinProblem(targ - nums[i], nums) == true)
return true;
}
return false;
}```