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