Strings Beautiful Binary String BeautifulBinaryString.java Strings Big Sorting BigSorting.java Strings Anagram Anagram.java Strings Two Strings TwoStrings.java Strings Funny String FunnyString.java Strings String Construction StringConstruction.java Strings Strings: Making Anagrams StringsMakingAnagrams...
import java.util.Scanner; public class Solution { static boolean isAnagram(String a, String b) { boolean x= true; if (a.length()!=b.length()){ x=false; } a= a.toLowerCase(); b=b.toLowerCase(); int al[]=new int [256]; for(char c : a.toCharArray()){ int i=(int) c;...
Anagram Java O(n) O(1) Easy 25 Making Anagrams Java O(n) O(n) Easy 30 Game of Thrones - I Java C# O(n) O(1) Easy 30 Two Strings Java C# O(|a| + |b|) O(1) Easy 25 a and b are lengths of the input strings String Construction Java O(n) O(n) Easy 25 ...
Anagram Java O(n) O(1) Easy 25 Making Anagrams Java O(n) O(n) Easy 30 Game of Thrones - I Java C# O(n) O(1) Easy 30 Two Strings Java C# O(|a| + |b|) O(1) Easy 25 a and b are lengths of the input strings String Construction Java O(n) O(n) Easy 25 ...
The king wants to lock the door, so that, the Dothraki can't enter. But, to lock the door he needs a key that is ananagramof a certainpalindromestring. The king has a list of words. Help him figure out if any anagram of the words can be a palindrome or not?
Two StringsO(n)O(1)ModerateStringSet20.025.0 SherlockAndAnagramsO(n^3lgn)O(n^2)ModerateStringSort, Dictionary, Permutation4.5550.0 Palindrome IndexO(n)O(1)EasyString25.025.0 Sherlock And Valid StringO(n)O(1)DifficultStringDictionary100.0100.0 ...
INPUT Hello,hello ; expected output:anagram ; actual : not anagram; public static boolean isAnagram(String a,String b) { char a1[]=a.toCharArray(); char b1[]=b.toCharArray(); java.util.Arrays.sort(a1); java.util.Arrays.sort(b1);...
One string must be “xy” and the other be “yx”. The length are a=2 and b=2, so the difference is less than 1. No changes are needed because the second string is already an anagram of the first. Collapse Question import java.io.*; ...
Anagram Java O(n) O(1) Easy 25 Making Anagrams Java O(n) O(n) Easy 30 Game of Thrones - I Java C# O(n) O(1) Easy 30 Two Strings Java C# O(|a| + |b|) O(1) Easy 25 a and b are lengths of the input strings String Construction Java O(n) O(n) Easy 25 ...
public class Solution { static boolean isAnagram(String a, String b) { // Complete the function a = a.toLowerCase(); b = b.toLowerCase(); boolean anagram = true; if (b.length() == a.length()) { java.util.Map amap = new java.util.HashMap<>(); java.util.Map bmap = new ...