The provided solution has mixed up left-justification and right-justification.
In C programming, Right justification is the default behaviour and don't need a '-' sign while left justification needs a '-' sign. In the solution it is written vice-versa.