Adding code for Sum with all permutation