solution of SUM_REC of array