A problem I was given requires us to solve using a backtracking style algorithm. I wrote one based upon a given solution to a similar problem, but I need it to be faster (run all test cases in under 3 seconds.) The problem statement is as follows: Given two numbers n and k, determine the ..

#### Category : recursive-backtracking

#include<iostream> using namespace std; int multiply (int num1, int num2){ if (num1 > 0) return num2 + multiply(num1-1,num2); } int main(){ int mult = multiply(5,6); cout<<mult; } I am trying to multiply two numbers through recurssion, but i am not getting the desired result, i want to print 30 but it is given me 36, ..

## Recent Comments