Correct answer but showing WA


Your submission failed for the following input:

A : [ "ABCD" ]
Your function returned the following :
The expected returned value :

How to get ‘ABCD’ the right way?


Add these two lines

if(size == 1)
return A[0];

I don’t know the reason why is this happening. I guess it is a bug on their side. If you get to know, please tell