a = ['ab', 'absa', 'sbaa', 'basa', 'ba']
res = []
s = 0
for i in range(len(a)):
b=a[i]
c = ''.join(sorted(b))
res.append(c)
res.sort(reverse=False)
wordfreq = [res.count(p) for p in res]
d = dict(zip(res, wordfreq))
all_values = d.values() #all_values is a list
max_value = max(all_values)
print(max_value)
max_key = max(d, key=d.get)
print(max_key)
In the given problem user inputs various anagram words, the output should be the maximum frequency of that word and print those anagrams. If you please help me print those anagrams from the input it will be really helpful.
Ooutput:
3 aabs
Expected Ooutput:
3
absa sbaa basa