Hello there,
I am attempting to sum every term in a list to its associated index.
so;
list1: 5 2 4 8 5
desired result:
list1: 6 4 7 12 10
My approach would be to write a loop that keeps going until it has completed the ‘size’ of the list
while counter <= size
list1[counter] == list1[counter] + counter
counter++
end
However, I am unsure what the syntax for this in q is. Any help would be greatly appreaciated.
Thanks,