Workaround for TLE prob of O(n)sol


Using append instead of + in the return string clears the problem.
e.g: ret.append("/"); instead of"/";
This solves the problem. While + creates a new list concatenating the given strings and returning the new list , append works “in place” and doesn’t return anything .


Thanks! This worked.


Thank you so much this worked!


Thanks man!
This saved me a lot of time.