Both responses are factually correct, but A is more helpful because it shows the full steps more clearly and is easier to read.
Both answers get the facts right, but A does a better job of walking you through the process step by step, making it much easier to follow along and understand what's happening.