score:2

Accepted answer

You're very close;

int ma = new[] {svar1, svar2, svar3, svar4, svar5}
             .Max(lst => lst.Max(str => str.Length));

should work.

score:1

You can use Concat instead of creating new List:

svar1.Concat(svar2).
   Concat(svar3).
   Concat(svar4).
   Max(str => str.Length);

This solution may be slightly faster if you have many short lists.


Related Articles