Welcome to LeetCode Discuss.  Please read the FAQ to help yourself making the best use of Discuss.
Ask a Question
Back to Problem

Welcome to LeetCode Discuss.

This is a place to ask questions related to only OJ problems.

Please read the FAQ to help yourself making the best use of Discuss.

Is it okay to use StringBuilder.reverse() in Java?

0 votes
90 views

For Java, I assume using StringBuilder.reverse() rather than a loop would make the code shorter and readable. However, is that usually allowed for an interview question like this?

asked Jan 28 in Valid Palindrome by stellari (200 points)

1 Answer

0 votes

do not think so.... that is also time-consuming, and you will have a time limit excess for a long input string.

answered 6 days ago by DonnieDarko (140 points)

...