Recursive Function to generate all non - increasing sequences with sum x arr [ ] -- > Elements of current sequence curr_sum -- > Current Sum curr_idx -- > Current index in arr [ ]
function generateUtil ( $ x , $ arr , $ curr_sum , $ curr_idx ) {