import java.util.Arrays
class Anagram {
String word
Anagram(String word){
this.word = word
}
def isAnagram(candidate){
if (candidate.equalsIgnoreCase(word)) return false
char [] cand = candidate.toLowerCase().toCharArray()
char [] wor = word.toLowerCase().toCharArray()
Arrays.sort(cand)
Arrays.sort(wor)
return Arrays.equals(cand, wor)
}
def find(candidates) {
String [] candV = []
def cand = candV.toList()
candidates.each { candidate ->
if(isAnagram(candidate)){
cand.add(candidate)
}
}
return cand
}
}
Thank you, friend!


I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
please click it!
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)
The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit