This task might have been difficult if we had to find the most powerful spell which also has the maximum length. Suppose our spell is a string S , if the given string contains the string S N times that means that any letter of S will be there at least N times. So by finding the letter which appears the most is one of the maximum spells.
No comments:
Post a Comment