I have the below 2 Problems asked yesterday in an interview
1> Given a string, compute a new string where identical chars that are adjacent in the original string are separated from each other by a "*".
Examples are as shown below::
function name is public String pairStar(String str)
pairStar("hello") → "hel*lo"
pairStar("xxyy") → "x*xy*y"
pairStar("aaaa") → "a*a*a*a"
2> Given a string, compute a new string where all the lowercase 'x' chars have been moved to the end of the string.
Examples are as shown below::
function name is public String endX(String str)
endX("xxre") → "rexx"
endX("xxhixx") → "hixxxx"
endX("xhixhix") → "hihixxx"
Im not sure how to accomplish the given set of problems, and struggling how to solve this