Hi,
We have an expression rule (see below image). We want to get the indices of numbers from the array (local!numberList) that would not make the local!initialValue negative when added together.
The result we are expecting from the sample values in the image is: {1, 2, 3, 5}
If we have local!initialValue = 100 & local!numberlist = {5, 100, 15, 100, 25}, the result should be: {1, 3, 5}
We're having a hard time thinking of the way we can do this. Would gladly appreciate your help.
Discussion posts and replies are publicly visible
Can you ellobrate what does added together means?
For the 5th iteration, we want the 4th item to be removed from the list to add, since having it would make the initial value negative. So for 5th iteration the value of sum should be 55 - the summation of indices 1, 2, 3,and 5 excluding 4.
Hey,
Could you please provide me the output of these test cases to enhance my understanding?
Initial Value: 100 for both cases.
Test Case 1:
[10, 5,100, 90, 25]
Test Case 2:
[5, 5, 100, 90, 10]
Test Case 1: {1, 2, 5}
Test Case 2: {1, 2, 4}