+ 5
Challenge #2
find the max element in the list within given min index to max index all programming languages are welcome example: list : 5 3 2 7 2 index : 1 3 max : 7 list : 5 3 2 7 2 index : 0 2 max : 5
7 Answers
+ 9
@luka Yup I'm interested with lambda syntax too but sometimes I find that it's weird to read so I just leave it.
Perhaps next time we can give it a try on next challenge! đ
+ 8
Here's my C# implementation! â
LINQ One-Lineră°
arr
.Skip(startIndex)
.Take(endIndex - startIndex + 1)
.Max()
Let's appreciate the succinctness of LINQ. Enjoy~ â€
https://code.sololearn.com/cN1UP0lGCY9O/?ref=app
P/S: Please add the challenge tag to attract more views~ đ
+ 6
https://code.sololearn.com/cThVKycwTuIj/?ref=app