Circuit (a) violates KVL because 2 V (the left voltage source) is not equal to 3 V (the right voltage source).
Circuit (b) doesn’t violate any law. The current through the circuit is 4 A. Thus the voltage across the resistor is 4 A • 1 Ω = 4 V, with the positive reference terminal at the top...