02-17-2016 01:56 AM - edited 02-17-2016 01:59 AM
Here are the two code versions I explained. That's all we need. There are many ways to do this.
It is easy to modify for other characterisitcs, e.g. user "greater" if elements should be increasing, etc.