Maximum Length Substring With Two Occurrences