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.
- Prepare
- Java
- Strings
- Java Anagrams
- Discussions
Java Anagrams
Java Anagrams
Sort by
recency
|
2495 Discussions
|
Please Login in order to post a comment
A bit of an odd solution, but the use of primes allows for a mathematic approach that doesn't require sorting and only requires traversing the arrays a single time. Not meaningfully better than storing an int in the index of the char value, but fun!
static boolean isAnagram(String a, String b) {
Why i can´t use streams?. The editor doesn't allow me add imports. Anyone, knows waht it happening?