hi , i m doing coding bat exercises in
java.
the question :
Given a
string, if the first or last chars are 'x', return the string without those 'x' chars, and otherwise return the string unchanged.
withoutX("xHix") → "Hi"
withoutX("xHi") → "Hi"
withoutX("Hxix") → "Hxi"
my solution:
what i don't get is why it never goes to * part of code
for example if the string given is "xHix" , it only deletes last x , but the first x is still there ,
and it gives wrong answer "xHi", but it should delete the first "x"