Both of the solution are correct. You just added an extra zero in the Solution zero.
Solution:
let us take that cost of a pencil is x and cost of the a pen is y
Then we can write:
y = 4*x
On taking 4x in LHS y - 4x = 0 (SOLUTION 1, CORRECT)
we can add zero to the both side of solution 1, it will be same.
y - 4x +0 = 0 + 0
y - 4x + 0 = 0 (SOLUTION 2, CORRECT AND SAME AS SOLUTION 1)