• + 1 comment

    If we have strings that are 1 letter difference but all equal length for all inputs then, yes I believe you are right. We would make n comparisons that each take at most m time where m is the length of a string. The good thing about this problem, is that all strings sum to give us a upper bound on length. So there is a way for us to calculate the worst possible input.