Make It Anagram

  • + 0 comments

    Python 2

    total += max(w1.count(letter) - w2.count(letter), w2.count(letter) - w1.count(letter)) if ((letter in w1 and letter not in w2) or (letter not in w1 and letter in w2) or w1.count(letter) != w2.count(letter)) else 0 
    

    or

    total += abs(w1.count(letter) - w2.count(letter)) if ((letter in w1 and letter not in w2) or (letter not in w1 and letter in w2) or w1.count(letter) != w2.count(letter)) else 0