problem : problem link
my solution : link to my solution
Your Code doesn’t work for input:
-2 -3 -4
Instead of finding the maximum value, find the minimum value and change it, here in this case Minimum value is -4. So that correct ans is -2 -3 3.