@@ -0,0 +1,2148 @@
+import java.util.ArrayList;%0D%0A%0D%0A/**%0D%0A *%0D%0A *The MIT License (MIT)%0D%0A *%0D%0A *Copyright (c) 2014 Abhijit Kumar%0D%0A *%0D%0A *Permission is hereby granted, free of charge, to any person obtaining a copy%0D%0A *of this software and associated documentation files (the %22Software%22), to deal%0D%0A *in the Software without restriction, including without limitation the rights%0D%0A *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0D%0A *copies of the Software, and to permit persons to whom the Software is%0D%0A *furnished to do so, subject to the following conditions:%0D%0A *%0D%0A *The above copyright notice and this permission notice shall be included in all%0D%0A *copies or substantial portions of the Software.%0D%0A *%0D%0A *THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0D%0A *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0D%0A *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0D%0A *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0D%0A *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0D%0A *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0D%0A *SOFTWARE.%0D%0A *%0D%0A **/%0D%0A%0D%0A/**%0D%0A * %0D%0A * Given two words, determine if the first word, or any anagram of it, appears%0D%0A * in consecutive characters of the second word. For instance, tea appears as an%0D%0A * anagram in the last three letters of slate, but let does not appear as an%0D%0A * anagram in actor even though all the letters of let appear in slate. %0D%0A * Return the anagram of the first word that has appeared in the second word.%0D%0A * %0D%0A * @author abhijitkumar2003%5Bat%5Dgmail%5Bdot%5Dcom%0D%0A * %0D%0A */%0D%0Apublic class AnagaramsSearcher %7B%0D%0A%0D%0A%09public void containsAnagramsOf(final String pattern, final String match) %7B%0D%0A%09%09Permutations permute = new Permutations();%0D%0A%09%09ArrayList%3CString%3E anagrams = new ArrayList%3CString%3E();%0D%0A%09%09anagrams = permute.getPermutations(pattern);%0D%0A%0D%0A%09%09boolean found = false;%0D%0A%09%09for (String str : anagrams) %7B%0D%0A%09%09%09if (match.contains(str)) %7B%0D%0A%09%09%09%09found = true;%0D%0A%09%09%09%09System.out.println(str);%0D%0A%09%09%09%09break;%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09if (!found) %7B%0D%0A%09%09%09System.out.println(%22NONE%22);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D%0D%0A

Solution to programming puzzle: Given two words, determine if the first word, or any anagram of it, appears in consecutive characters of the second word. For instance, tea appears as an anagram in the last three letters of slate, but let does not appear as an anagram in actor even though all the letters of let appear in slate.