Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
154 views

I'm working on a Java problem where I need to group words that are anagrams of each other. For instance, given the input array: ["eat", "tea", "tan", "ate", &...
Pabitra's user avatar
1 vote
2 answers
70 views

How can I check in LibreOffice Calc whether two words have the same letters, i. e. are anagrams? Is this doable with the built-in functions? Edit: My idea is: convert the letters in both words to ...
Alexander Bösecke's user avatar
0 votes
1 answer
103 views

leetcode Problem 242 Given two strings s and t, return true if t is an anagram of s, and false otherwise. Read the following code as my approach to solve: class Solution: def isAnagram(self, s: ...
talkandtalkers's user avatar
1 vote
1 answer
103 views

I have wordlist.txt that separated by new line. If I specify number of quotas to use for each alphabet for example n: 1 e: 1 w: 1 b: 1 o: 2 k: 1 Remain alphabets quota is 0. How to construct a ...
Muhammad Ikhwan Perwira's user avatar
0 votes
0 answers
107 views

I am having extreme difficulties in figuring out where my code is wrong in an anagram hunt vue.js app I am creating. At the beginning of the game, the player chooses the word length from a drop down ...
Timothy Test Sr's user avatar
-2 votes
1 answer
210 views

Here's the prompt: Given two strings s and t, return true if t is an anagram of s, and false otherwise. I tried to fix it by creating an if statement that would check if both Hashmaps are of the same ...
egoldman's user avatar
2 votes
2 answers
264 views

I received this question in an interview, and coded out a solution, but it was not optimal. Given a stream of words such as: army, ramy, cat, eat, tea.... How can you store these words to support the ...
Alice the SWE's user avatar
1 vote
1 answer
34 views

I want to find the anagram phase from the dictionary which checks it against the word mentioned by the users. A few examples, have shared :: Example: i/p --> Barbara Bush, o/p {"abash", &...
Mrugesh's user avatar
  • 4,537
0 votes
1 answer
161 views

I tested my code on an online editor and it worked fine with all examples I tested, but it fails when I submit it to LeetCode. Why? LeetCode submission result: Wrong Answer 24 / 38 testcases passed ...
tom_so's user avatar
  • 121
-2 votes
3 answers
959 views

Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all ...
guardianOfTime's user avatar
0 votes
1 answer
51 views

I'm new to C and trying to make an anagram finder, but it doesn't work correctly and I'm not sure where I've gone wrong. It works by counting the number of letters in 2 different strings using 2 ...
lukimari444's user avatar
2 votes
4 answers
2k views

I want to code a function in Python returning all possible anagrams of a word given. Only words of the English language are considered as such. However, up to now, I only managed to generate all ...
turalson's user avatar
  • 131
2 votes
3 answers
119 views

I've tried to create a function that returns True if two words are anagrams (have the same letters) to each other. I realized that my counter counts to 13 but not sure what is the issue. def ...
Yael Chen's user avatar
-1 votes
1 answer
80 views

I am struggling to create an order of string using counter in python and my program is not printing an order of the given string below. from collections import Counter, defaultdict def ...
Themba2023 Bhele's user avatar
-6 votes
1 answer
319 views

I need find and delete all anagrams from an array. All my attempts give ["bac","art"], but I need ["art"] const deleteAnagrams = (arr) => { let obj = {}; for (...
aftab's user avatar
  • 15
0 votes
0 answers
126 views

In my code at line it is showing index -97 outofbound. Why it is showing that? Where is the problem with my code? I don't understand why it is showing. What is wrong with my code or my logic? class ...
Its Me Pratham's user avatar
-2 votes
2 answers
358 views

I'm trying to write a function where it takes in two lists of any length, and returns True if list_1 has any words that are anagrams in list_2, and false if not. For example: words1 = [“dog”, “kitten”]...
mlenthusiast's user avatar
  • 1,264
0 votes
3 answers
167 views

i a m a begginner in ruby please i need directions in how to get the program to return a list containing "inlets" Question: Given a word and a list of possible anagrams, select the correct ...
Precious's user avatar
0 votes
1 answer
78 views

So, the problem is: Given an array of m words and 1 other word, find all anagrams of that word in the array and print them. Do y’all have any faster algorithm?:) I’ve succesfully coded this one, but ...
ThirstyMango's user avatar
0 votes
1 answer
75 views

This is my code : string_1 = input("Enter a string : ") string_2 = input("Enter a second string : ") a = sorted(string_1) b = sorted(string_2) print(a) print(b) if a in b and len(a)...
momo123321's user avatar
0 votes
0 answers
69 views

This method should return the largest group of anagrams in the input array of words, in no particular order. It should return an empty array if there are no anagrams in the input array. This method ...
Preston Little's user avatar
-1 votes
1 answer
128 views

Im trying to find/write a function to compare two words in a Python program that solves a word puzzle game. The goal of the game is to create as many word as possible using a set of 9 letters, the ...
Theo Friberg's user avatar
0 votes
1 answer
374 views

I've been trying to find a solution to this problem however I can not seem to find out how to match my output with the expected output. Here's the problem: Given an array of strings strs, group the ...
Calvin Nguyen's user avatar
2 votes
1 answer
226 views

Today I came across a solution for this problem: https://leetcode.com/problems/group-anagrams/submissions/ The author used AbstractList to solve this problem. And the solution looks somewhat like this ...
ZodiacLeo123's user avatar
0 votes
1 answer
108 views

void anagram(char s[],char s1[]){ // Using Hashmap of size 26 (0 - 25) int i,H[26]={0}; for(i=0;s[i]!='\0';i++){ H[s[i]-97]+=1; } for(i=0;s1[i]!='\0';i++){ H[...
Suba's user avatar
  • 29
-2 votes
1 answer
293 views

First. I create a group of 5 labels using a for for (byte fila = 0; fila < 5; fila++) { Label letras = new Label(); letras.Height = alto; letras.Width = ...
Steregama's user avatar
1 vote
1 answer
70 views

I use two 26 element arrays in my program. What is the time and space complexity for this program to find if a string is an anagram of another? int arr1[26] = { 0 }; int arr2[26] = { 0 }; for (char&...
Samyukta's user avatar
0 votes
1 answer
2k views

I need to compare 2 strings and see if the number of every character each of them contain is the same. Requirement: Without using any packages or imports My idea: I want to check if a char from ...
jgrewal's user avatar
  • 342
1 vote
2 answers
1k views

I have to calculate how many anagrams are in a given word. I have tried using factorial, permutations and using the posibilities for each letter in the word. This is what I have done. static int ...
Skike's user avatar
  • 63
0 votes
3 answers
306 views

I am a complete beginner in programming and I am trying to a write code to check if a word is an anagram whose output must be a boolean. When I run the code, the list of anagrams would include the ...
Rukia's user avatar
  • 11
0 votes
3 answers
7k views

Hi im trying to solve this riddle: Given an array of strings, remove each string that is an anagram of an earlier string, then return the remaining array in sorted order. Example str = ['code', 'doce',...
Leonard RT's user avatar
-2 votes
1 answer
822 views

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, ...
Sushant Chhetry's user avatar
2 votes
2 answers
158 views

code--> class Solution: def isAnagram(self, s1: str,t1: str) -> bool: flag=1 s = list(s1) t = list(t1) for i in range(len(s)): for j in range(len(...
code_dominar's user avatar
3 votes
4 answers
848 views

What is the most straightforward way to check whether two strings are anagrams? i.e. they share the same letters as well as number of occurrences of each these letters (and possibly other characters). ...
Maël's user avatar
  • 53k
1 vote
0 answers
529 views

Following is editorial solution approach to Leetcode problem 49. Group Anagrams. Problem statement Given an array of strings strs, group the anagrams together. You can return the answer in any order. ...
Kumar Ashutosh's user avatar
2 votes
1 answer
376 views

Let assume I have a word word = abcde And a score board to show that the position of the characters in the word is correct or not in comparison to my desired output score = [T, F, F, T, F] Where T ...
241ringgit's user avatar
0 votes
1 answer
113 views

I want to write a function that finds anagrams. Anagrams are words that are written with the same characters. For example, "abba" and "baba". I have gotten as far as writing a ...
António Rebelo's user avatar
0 votes
1 answer
322 views

Through youtube, I've learned to obtain a multi-dimensional output of permutations using recursion, i.e anagrams with passing in an array of letters as an argument (i.e ['a', 'b', 'c']) but is there a ...
Enochy's user avatar
  • 11
2 votes
1 answer
145 views

Question with below code. If I'm decreasing the object value and when it comes to zero how it is satisfying this condition if(!obj1[letter]) because letter still exist in obj, its value is just going ...
Anamika Singh's user avatar
1 vote
2 answers
160 views

I am writing code to check if two words are anagrams of each other. But when I run this program, it is telling me that "tacocat" and "tacocatt" are anagrams of each other and they ...
hershey10's user avatar
-1 votes
2 answers
1k views

I'm testing some ways to identify anagrams and I found a situation that got me off guard. I found out that it's possible to do using XOR so I was testing it using the XOR operator. Here's my code: ...
machinegarens's user avatar
1 vote
1 answer
31 views

The below code doesnot work. Why the map function is returning type error? I have tried a many times. can someone give a proper reason for the below code? n=26 string_array_1=[0]*n string_array_2=[0]*...
noob_404's user avatar
1 vote
2 answers
559 views

Suppose there are two arrays of strings. One array is named query, and the other one is named dictionary. For each string element of the query, you need to find how many anagrams of it exist among the ...
belmont's user avatar
  • 225
1 vote
1 answer
626 views

I have been trying to create a program that can find all the anagrams(in the list) for each word in the text file (which contain about ~370k words seperated by '\n'). I've already written the code in ...
Deera Wijesundara's user avatar
-1 votes
3 answers
1k views

I was asked to write a function to arrange a given number to get its maximum number. The output is correct, but I keep getting None beside the rearranged number. Obs: I don't want a new code. I want ...
IXZLY's user avatar
  • 7
1 vote
3 answers
87 views

I'm currently trying to make a very fast anagram solver, and right now it's bottlenecked by the creation of the permutations. is there another way to do the whole program or to optimize the ...
Enz's user avatar
  • 119
2 votes
1 answer
205 views

For a given word calculate the number of possible anagrams. The resulting words do not have to exist in the dictionary. Anagrams do not have to be repeated and anagrams do not have to be generated, ...
user avatar
0 votes
2 answers
295 views

The task I'm writing a script for is finding anagrams and then sorting words in the descending order of the number of anagrams found (or alphabetically when the number for two words is the same). My ...
balkon16's user avatar
  • 1,467
2 votes
3 answers
525 views

The original problem is here: Design a O(N log N) algorithm to read in a list of words and print out all anagrams. For example, the strings "comedian" and "demoniac" are anagrams ...
faith's user avatar
  • 121
0 votes
2 answers
182 views

"Write a recursive function called anagram(s) that returns a list of all the possible anagrams of the string, s." Can I get some guidance on how to tackle this question? I am new to ...
Luu Luu's user avatar

1
2 3 4 5
11