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
|
2433 Discussions
|
Please Login in order to post a comment
I know this ain't a appropriate way for a soln but I just started solving coding proplems...please give me a tips to improve thanks!
import java.util.Scanner;
public class Solution {
}
static boolean isAnagram(String a, String b) {
//Checking two strings lengths
2.//Converting the string of characters into Uppercase (we can use Lowercase too)
3.//converting strings into Character Array
4.//Sorting two Character Arrays
//Checking the two Arrays character by character
for(int i=0;i<=ch1.length-1;i++) { if(ch1[i]!=ch2[i]) { return false; } } return true;
}