Eirikur Eiriksson (8/27/2014)
keshabsingh (8/27/2014)
This is not homework session. Your approach is very limited with hard coding the values. What if data is like this?Then, that in itself is a change to the initial requirements, which mind you are more limited than my hard coded values.;-) The sum of the values indicate a certain sequence could be another hint there who knows?
It all boils down to the basics, if you are looking for a proper answer, ask a proper question!
😎
I thought the OP asked a pretty good question not to mention posting readily consumable data and the expected result. It's our "job" to remember that it's just test data and will vary in real life... just like we sometimes explain to other OPs. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.