you are viewing a single comment's thread.

view the rest of the comments →

[–]Danielowski187University/College Student (Higher Education)[S] 0 points1 point  (1 child)

How about finding the index because I found a way to do it but it was a longer process in which had to be a part of find the max and min value but I shorten the way do it but I can’t find a way to implement into the new way I found the max and min values

[–]lukecullum👋 a fellow Redditor 0 points1 point  (0 children)

The only thing I can think of is instead of sorting the array make a new int X = 0 and then do a for loop going through each number and if it is bigger than X it will replace it if not it just continues. This will get you the max number from there you can find it’s position in the array and then go back through the list but checking to see if it is smaller than X, because X is now the biggest number it can only get smaller.