The correct option is A gets compressed
Spring can be assumed as the coil parallel to each other.
So, when current flows in spring each coil gets current flow in same direction. So, they are attracted to each other which in turn results in compression of spring.