You are viewing a single comment's thread. Return to all comments →
wouldn't it be better to use StringBuffer ?
Yes it would have been memory efficient and less time consuming but as this passes all test cases so have not made other effort,
but it should be good programming practise to use StringBuffer instead. :)
String buffer seems to be leading to timeout. String works better.
This times out on 4 or 5 test cases