Case 2 : Add current element to value so far if result is less than or equal to maxLimit .
if ( $ num + $ arr [ $ ind ] <= $ maxLimit ) { findMaxValUtil ( $ arr , $ n , $ num + $ arr [ $ ind ] , $ maxLimit , $ ind + 1 , $ ans ) ; } }