Hello
I have a list perhaps like this:
list = {1, {1, 2, 3}, {{1, 2}, 3}}
I search all postions with the Value 1:
pos = Position[list, 1]
{{1},{2,1},{3,1,1}}
I want to replace the 1 at the last position:
list[[3, 1, 1]] = 9;
{1,{1,2,3},{{9,2},3}}
My problem is, that i want to take the position for the last 1 from the position-list (I saved above as pos).
list[[pos[[-1]]]] = 9;
I know that this doesnt work, because pos[[-1]] is a list. Is there a solution, do make it working?
Would be great if someone could help me.
Kind regards!