I do not understand why
} else if ((t.length() == result.get(0).length()))
and
if ((t.length() < s.length()) && (s.length() != result.get(0).length()))
returns as true when it is not. I have tested my code with: grandfather grandmother daughter program car and grandmother daughter program car bar It will find the shortest string but it will not save multiple strings of the same length. Any assistance would be appreciated