Finding anagrams for a given word

后端 未结 12 1063
温柔的废话
温柔的废话 2020-12-04 07:43

Two words are anagrams if one of them has exactly same characters as that of the another word.

Example : Anagram & Nagaram are anagrams

12条回答
  •  旧时难觅i
    2020-12-04 08:09

    tried to implement the hashmap solution

    public class Dictionary {
    
        public static void main(String[] args){
    
        String[] Dictionary=new String[]{"dog","god","tool","loot","rose","sore"};
    
        HashMap h=new HashMap();
    
        QuickSort q=new QuickSort();
    
        for(int i=0;i

提交回复
热议问题