There should be a greedy parse method that tries to include as many symbols as possible and returns the first index in the string that it cannot use.