Event: Uipath calls c# code to implement a function (the sum of the values in an array is equal to a fixed value and the Numbers are retrieved)
The problem: use the invoke code to report an error. I don’t know what the problem is
The code:
public static IEnumerable<string> GetCombinations(int[] set, int sum, string values) {
for (int i = 0; i < set.Length; i++) {
int left = sum - set[i];
string vals = set[i] + "," + values;
if (left == 0) {
yield return vals;
} else {
int[] possible = set.Take(i).Where(n => n <= sum).ToArray();
if (possible.Length > 0) {
foreach (string s in GetCombinations(possible, left, vals)) {
yield return s;
}
}
}
}
}
error: