Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How can I get the high value numerals to the lowest and also get its original index values?
If two(or more) numbers comes same, both should count.
Ex. 2 & 4
here 25 is the biggest value, we should know it is the biggest and also its index ie, 12
likewise 21 is the 2nd biggest value, we should know it is the 2nd biggest and also should know its index = 10
likewise 18 is the 2nd biggest value, we should know it is the 2nd biggest and also should know its index = 11
.
.
.
4 & its index value
Another 4 & its index value (There are two 4's in the array, likewise there are two 2's in the array)
.
.
.
n number. Here the number with lowest value and what its index is!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: In an array get the high value numerals to the lowest and also get its original index values
by BrowserUk (Patriarch) on Apr 15, 2016 at 11:43 UTC | |
by Anonymous Monk on Apr 20, 2016 at 07:37 UTC | |
|
Re: In an array get the high value numerals to the lowest and also get its original index values
by stevieb (Canon) on Apr 15, 2016 at 11:56 UTC | |
by Anonymous Monk on Apr 20, 2016 at 07:38 UTC | |
|
Re: In an array get the high value numerals to the lowest and also get its original index values -- oneliner
by Discipulus (Canon) on Apr 20, 2016 at 09:05 UTC |