You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
Make It Anagram
You are viewing a single comment's thread. Return to all comments →
Python 2
or