Narendra Harny
Mar 15, 2021

--

Hi,

Yes -1 returns last element, you can understand it the negative indexing starts with last element -1, -2 and so on..

And about sorting I suggest that if someone knows how sorting works and aware of sorting algorithms then use the max function but if someone is a beginner in coding, should also learn how sorting works.

Hope I answer your question

Thanks

--

--

Narendra Harny
Narendra Harny

Written by Narendra Harny

Connect on https://medium.com/make-android | Write On, Android AOSP & Applications | Python | DevOps | Java | C++ | Kotlin | Shell | Linux | Android Auto | IVI

Responses (1)