I wrote couple of posts previously here and here on how to find duplicates in an array and we saw different variety of that problem. I want to sw...
For further actions, you may consider blocking this person and/or reporting abuse
very , very small optimization :p
if by any chance you can benchmark the 2 versions : me very glad ;)
JavaScript!!
Go! This was a fun challenge as I'm fairly new to Go =) Feedback is welcomed!
Python!!
Here’s a challenge for you. You wrote the same loop twice. Could you write a function that takes an anonymous function as an arg so you never have to write this “dual ended” loop again?
why not just this
public static boolean isPalindrome(String str) {
return str.equals(new StringBuilder(str).reverse().toString());
}
You are using Java's in built reverse method. Normally in an interview, you create your own algorithm i.e. your own implementation of reverse method.
Oh OK these post are like examples for juniors when doing interview and stuff