Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReverseTheString.cpp . is failing for input string as "j" of size 1. #18

Open
harendra247 opened this issue Feb 4, 2020 · 1 comment

Comments

@harendra247
Copy link

if ( A.length() == 1) {
result = A;
return result;
}
above code can be added.

@cruxrebels
Copy link
Owner

I understand this wouldn't help since the problem is about reversing a worded string. This check in the beginning would have made more sense if the problem would have been about reversing characters in a string. Let me know if am missing anything?


https://github.com/cruxrebels/InterviewBit/blob/master/Strings/ReverseTheString.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants