Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
order n^2 is slow
lamda expressions with stream.
Read this: https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
it is the for-each loop in java.
https://www.geeksforgeeks.org/for-each-loop-in-java/
Since C strings end with a NUL character, and that character evals to false, it can be used to iterate through all chars in the string. Extra attention needed when used with a string obtained from stdin, since if it fails for some reason, it may not have it.
This comment is hidden because it contains spoiler information about the solution
Na, it's important to give that kind of feedback. We see far too often solutions with bad time complexities that are voted as best practices while there are more efficient and yet simple solutions.
The user is 7kyu. That they solved the problem correctly with such readable code is impressive. Give them a break :)
O(n2)
You shouldn't need to do the input.Length on both sides of the comparison, just the comparison of the values after the replace would do