❔ Finding max from the list using lambda expression

Hello, I have an example of a following list, something like {1, 2, 3, 4, 5, 6}

I want to find the max element of this list using lambda expression. So this is what I coded

List<int> sample;
int max = sample.Max(e => e);

Do we have to fill in the expression in List.Max? Is there other way to do it? Thank you.
Was this page helpful?