# Phillip Small

Greenhorn
since Nov 07, 2018
Cows and Likes
Cows
2
In last 30 days
1
Total given
0
Likes
0
0
Total given
4
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by Phillip Small

That makes logical sense.  You make it sound easy.  This thing is killing me.  Thanks for your assistance.  Maybe, I should just start over.
1 month ago
Yes, this is the case Piet.
1 month ago
Thanks for the great advice everyone.
1 month ago
I self-corrected my statement in a reply right after that.  My mistake.  you are absolutely correct.  Thanks for the catch.
1 month ago
Yes Junilu.  basically, I am trying to figure out how to get the position.  the code will loop through and find the correct value based on the values in the array.
1 month ago
That would work as well.
1 month ago
This seems like I will have to rewrite most of it.  Is there any quicker way so that I can change what is printed?  The position rather than the value? I assumed that the change would be in this line-

System.out.println("sum("+Arrays.toString(partial.toArray())+")="+target);

But I guess it is not that simple.  Regarding streams, would I add that at the end of the previous code?  I am confused by this.  System.out.printf("Sum = %d%n", List.of(5, 5, 10, 15)
.stream()
.mapToInt(i -> i.intValue())
.sum());
1 month ago
I have some code that prints out the summary of a given array but want to know how to print the position rather than the value inside the sum?

The current output is:

sum([5, 10])=15
sum([5, 10])=15
sum([15])=15

I am trying to figure out how to get the output to print the position of the array:

sum([3]) = 15
sum([0,3)] = 15
sum([1,3)]=15
1 month ago