Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieve maximum value  RSS feed

 
Shafian Kisna
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I need your help urgently...how can i retrieve the maximum value of range of values, in long format, stored in an array?
I can used the traditional if-else but its too lengthy and my values in the array can increase.

Can someone pls help?

Thanks
Best Regards
SK
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's start off this way...

if you had 10 slips of paper in front of you, each with a number on it, how would you find the largest number written down?
 
Nirmal Vidura
Greenhorn
Posts: 9
Hibernate jQuery Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great example. Write down the solution in English.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!