getSubstringOfExponent() condenses getHighestDegree() and will be used in solveWhenXisOne()