-
-
Save cohen990/46d476750508bd34447c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int max = 0; | |
for(int i = 0; i < myArray.length; i++){ | |
if(myArray[i] > max){ | |
max = myArray[i]; | |
} | |
} | |
int maxIndex = 0; | |
for(int i = 0; i < myArray.length; i++){ | |
if(myArray[i] > myArray[maxIndex]){ | |
maxIndex = i; | |
} | |
} | |
for(int i = maxIndex; i < myArray.length - 1; i++){ | |
myArray[i] = myArray[i+1]; | |
} | |
myArray[myArray.length - 1] = Integer.MINIMUM_VALUE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment