The problem isn't phrased quite clear. Substracting input A from input B (or vice versa) means, that the output signal covers the voltage range -10 to +10V. Is this what you want? Then a +/- 15V supply would be needed. The said 0 - 10 V output would require an absolute value function, or in other words, a full wave rectifier.
Using a comparator in an OP circuit will result in oscillations. Furthermore, LM393 has an open collector output and would need an additional pull-up resistor to produce positive output voltages. Any standard OP will be good for this circuit.