We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The previous one-liner solution is awsome! My idea was to use "converging iterators" approach that works in-place without copying the data (sub-strings, concatenation, etc.). What's more, this approach is very fast as it may give an answer even before reading the whole string, possibly after comparing just two letters!
Java String Reverse
You are viewing a single comment's thread. Return to all comments →
The previous one-liner solution is awsome! My idea was to use "converging iterators" approach that works in-place without copying the data (sub-strings, concatenation, etc.). What's more, this approach is very fast as it may give an answer even before reading the whole string, possibly after comparing just two letters!