Asterix needs to solve a problem to find the secret ingredients for the Magic Potion. Getafix provided each villager with a string and said to find all substrings that appear at least twice, as these would reveal the ingredients. To solve this, Asterix must build a suffix tree to efficiently find all repeated substrings in O(N^3) time before the writing disappears. The document then explains the node structure of a suffix tree and provides examples and functions to output the intermediate and final suffix trees and repeated substrings.