Challenge #2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

6th Oct 2017, 5:33 AM
Amar Dahake
5 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! 😄
6th Oct 2017, 3:34 PM
Zephyr Koo
Zephyr Koo - avatar
+ 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~ 😉
6th Oct 2017, 12:00 PM
Zephyr Koo
Zephyr Koo - avatar
6th Oct 2017, 6:04 AM
Ankit Agrawal
Ankit Agrawal - avatar
+ 6
https://code.sololearn.com/cThVKycwTuIj/?ref=app
6th Oct 2017, 8:15 AM
Edward Fish
Edward Fish - avatar
14th Mar 2018, 11:26 AM
m_sudhu
m_sudhu - avatar