← All problemsSign in

RECURSION LOVE 2

Consider the following Recursive Function : int fun( int num , int val ) { if(num%val==0) return val; return fun(num,val-2); } You are given an interval of integers [A,B]. For each number (num) in this interval compute fun(num, num - ((num+1)&1) ). Output the sum of the value return by the function for each number in the given interval. ###Input: - Firs

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start