First solution is ok but why int[] a = new int[256] ? new int [123] would be enough to solve this problem so you have just create unnecessary bigger array.. And other two solutions aren't allowed in this problem because of it is only allowed to import "java.util.Scanner" nothing ...
Log In Sign Up Prepare Java Strings Java Anagrams Editorial Java AnagramsProblem Submissions Leaderboard Discussions Editorial This editorial requires unlocking.If you unlock the editorial, your score will not be counted toward your progress. Yes, I want to unlock Need Help? View discussions View top...
hackerrank solutions java GitHub | hackerrank tutorial in java | hackerrank 30 days of code solutions | hackerrank algorithms solution | hackerrank cracking the coding interview solutions | hackerrank general programming solutions | hackerrank implementation solutions | hackerrank data structures solutions in ...
Java Anagrams Here is my answer using java charaa[]=a.toLowerCase().toCharArray();charbb[]=b.toLowerCase().toCharArray();if(a.length()!=b.length()){returnfalse;}else{java.util.Arrays.sort(aa);java.util.Arrays.sort(bb);returnjava.util.Arrays.equals(aa,bb);} CAN YOU HELP ME OUT...
Java Anagrams Please someone help me.Compiler throws "IndexOutOfBoundsException" for four cases: staticbooleanisAnagram(Stringa,Stringb){// Complete the functionint[]arrA=newint[26];int[]arrB=newint[26];for(inti=0;i<26;i++){arrA[i]=0;arrB[i]=0;}for(into=0;o<a.length();o++)...
Privacy Preference Center When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information ...
Java Anagrams Hi, I recently joined hackerrank and started solving the problems. I would like to know what the significance of decreasing the frequency. Can you please explain that?
Privacy Preference Center When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information ...
//Validations if(a.length()==b.length()){ String A=a.toLowerCase(); String B=b.toLowerCase(); char temp; char string1[]= A.toCharArray(); int len=string1.length-1; //Sort character in an array for (int i = 0; i <= len; i++) ...
Java Anagrams This is better :D (eso espero (?) ) static boolean isAnagram(String a, String b) { a = a.toLowerCase(); b = b.toLowerCase(); int quanty = a.length(); if( b.length() != quanty ){ return false; } char[] A = a.toCharArray();...