Questions tagged [anagram]

A word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman.

531 questions
-2
votes
1 answer

Anagrams in Swift with wildcard (or joker)

Based on this function in Swift: func anagrams(word: String, from words: [String]) -> [String] { let anagrammedWord = word as NSString let length = anagrammedWord.length var aDic = [unichar:Int]() for i in 0..
-2
votes
2 answers

"==" always returning true. Anagram program

I have made a simple function which checks if two words are an anagram by sorting and comparing the sorted values, however this program always returns true even if the words aren't anangrams. If I remove the .ToString() it evalutates as false. Any…
Ay Jay
  • 45
  • 4
-2
votes
1 answer

Angram Strings in Java

I am trying to create an anagram generating program in Java. I am using String.toCharArray(); to store the word character by character. To get the anagrams done, I need to invert the values between two array positions. How do I do this?
-2
votes
4 answers

C++ How to ignore the difference between upper and lower when checking Anagram?

bool isAnagram(string s1, string s2){ if(s1.length() != s2.length()) return false; for(int i =0; i
LEO
  • 3
  • 2
-2
votes
1 answer

lavinshtein distance with dictionary

How to advance edit distance with operation take an anagram of the existing word. every interim step must be a word from a list of words .
-2
votes
1 answer

Java Anagram - Simple Challenge

Hello Stack Overflow Community. I developed a simple Java program to detect whether or not a word entered by the user is an Anagram. I do not receive the expected output based on the boolean value. Any ideas or suggestions are appreciated. Note:…
Farhan Ishraq
  • 25
  • 2
  • 9
-2
votes
1 answer

C - Count the number of combinations possible in a string without repetitions

Good night, what's the best way in C to count the number of possibilities of UNIQUE anagrams in a string with the maximum length of 256 without allows repetitions caused by same letters? The input would be just in uppercase and only alphabet letters…
Adriano rox
  • 173
  • 1
  • 8
-2
votes
3 answers

Java Beginner, comparing strings in nested for loop

Here is the problem statement: Write a function that compares 2 strings to return true or false depending on if both strings contain the same letters. Order doesn't matter. I do not know how to properly compare the character arrays in my nested for…
waffles
  • 208
  • 2
  • 11
-2
votes
1 answer

Anagram code meaning

In the below code, what is the meaning of the following line? m.put(alpha, l=new ArrayList()); Code (for finding Anagrams): try { Scanner s = new Scanner(new File(args[0])); while (s.hasNext()) { String word = s.next(); …
hmharsh3
  • 335
  • 3
  • 11
-2
votes
2 answers

What should be the logic of hashfunction() in order to check that two strings are anagrams or not?

I want to write a function that takes string as a parameter and returns a number corresponding to that string. Integer hashfunction(String a) { //logic } Actually the question im solving is as follows : Given an array of strings,…
-2
votes
1 answer

Group together all the anagrams

Problem statement: You are given a set of k strings, each length n. You have to output the group of anagrams together. Anagrams are like e.g atm - mat , like-kile.
Jatin Ganhotra
  • 6,825
  • 6
  • 48
  • 71
-2
votes
1 answer

Python 3 - Nested for loops with .count() to check string count per character in word

Here I'm asking for a word, and generating a list of all combinations for the letters in word variable, in theory (in my head) the for loop's if statement should work. from itertools import product from string import ascii_lowercase word =…
CryptoCo
  • 79
  • 1
  • 1
  • 7
-2
votes
1 answer

How to scramble a String

I'm trying to make an Anagram puzzle where I input a word (for example, fire) and it scrambles it randomly around for me (and it ends up like "rfie", "frei", etc...) Below is the basics of what I'm trying to do. All I need to know is how to scramble…
-2
votes
1 answer

Need an algorithm... not sure what this is called

Given a string: "ABCD", return the substrings with one or more missing characters keeping the order of the strings. This doesn't seem to be a "permutation", but I'm not sure if this algorithm has a name. I am using this to generate anagrams of a…
Cliff Helsel
  • 920
  • 1
  • 12
  • 26
-3
votes
1 answer

Using ASCII to find valid Anagram

Why doesn't this solution work for finding valid anagram? 26/36 test cases get passed in LeetCode. class Solution { public boolean isAnagram(String s, String t) { int sASCII = 0, tASCII = 0; if(s.length() !=…