+ 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
5 Respostas
+ 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