12213 should be the right code, as you gotta remove 1 for blue due to the torch.
i feel stupid..
first block: Add purple orb, ignore blue orb
+1 + 0 = 1
second block: add blue orb, remove blue orb, add purple orb, add green orb
+1 -1 +1 +1 = 2
third block: add blue orb, remove blue orb, add blue orb??
not sure how that ever becomes a 2.
Fourth block: add blue orb, remove blue orb, remove green orb and ignore black orb
+1 -1 -1 + 0 = -1 = 1??
fifth block: add black orb, add green shiny orb, add green shiny orb, add black orb
+1+1+1+1 = 4?
can someone explain this to me in depth?