function findCombinations(n) {
    const result = [];
    // array to store the combinations
    // It can contain max n elements
    const arr = new Array(n);

    //find all combinations
    findCombinationsUtil(arr, 0, n, n, result);

    return result;
}
/**
 * finds out all combinations of positive numbers that add upto given number.
 * @param {number} n
 */
finds out all combinations of positive numbers that add upto given number.
@param {number} n
finds out all combinations of positive numbers that add upto given number . @param { number } n
function findCombinations(n) {
    const result = [];
    const arr = new Array(n);
    findCombinationsUtil(arr, 0, n, n, result);
    return result;
}
function findCombinations ( n ) { const result = [ ] ; const arr = new Array ( n ) ; findCombinationsUtil ( arr , 0 , n , n , result ) ; return result ; }
finds out all combinations of positive numbers that add upto given number.
finds out all combinations of positive numbers that add upto given number .
// array to store the combinations // It can contain max n elements //find all combinations