Dear Aman
In this type of questions, we have to take the boundary
Like
1)- when x
2 -x + 4- x = 2
2 x = 4
x = 2
2)- when x is between 2 & 4
x -2 + 4 -x = 2
2 = 2
That means for every value between 2 & 4 , it is valid
3)- when x>4
x-2 + x-4 = 2
x = 4
Hence solutions of x is
[2, 4]
But if we are asked integral solution that x = 2,3,4
Regards
Arun (askIITians forum expert)