I am trying to solve a problem in hacker rank the given array is arr=["dd","dda","ddb"]
According to problem I had to make a string in alphabetic order the correct o/p for this according to hacker rank is "ddaddbdd"
For some test case the sorting and joining work but most of test case does not pass> Any recommendation to approach this problem?
I tried to sort the string and then join them like below but did not get the the output.
arr=arr.sort((a,b)=>a.localeCompare(b));
str=arr.join("")