You have unread notifications. Click here.

ATM (Advanced Recursion)

Loading ...
Start Coding
#include <iostream>
#include <vector>
using namespace std;
int solve(vector<int> &x, int y,int i, int sum){
-if( i == x.size() || sum >= y)
--return sum==y;
-return solve(x,y,i, sum+x[i]) + solve(x,y,i+1, sum);
int main() {
-vector<int> wael={1,2,5};
-int y = 10;
-cout<< solve(wael,y,0,0) <<endl;


English Version


Answer the following questions according to what you learned from the video.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Comments & Feedback

ملحوظة يتم مراجعة التعليقات قبل ظهورها من قبل الإدارة. رجاء عدم كتابة نفس التعليق أكثر من مرة.
Back to Course