Skip to main content

Posts

Showing posts with the label Java Anagrams Hackerrank Solution

Java Anagrams Hackerrank Solution

 Java Anagrams Hackerrank Solution For Explanation Watch Video: Sample Input 1 anagramm marganaa Sample Output 1 Not Anagrams Sample Input 2 Hello hello Sample Output 2 Anagrams Code: import  java.util.Scanner; public   class  Solution {      static   boolean  isAnagram(String a, String b) {          a = a.toLowerCase();         b = b.toLowerCase();         char[] ch1 = a.toCharArray();         char[] ch2 = b.toCharArray();         java.util.Arrays.sort(ch1);         java.util.Arrays.sort(ch2);         String s1 = new String(ch1);      ...