Libraryless. Click here for Pure Java version (9202L/50K).
1 | static int indexOfHighest(int[] array) { |
2 | if (empty(array)) ret -1; |
3 | int idx = 0, val = array[0]; |
4 | for (int i = 1; i < array.length; i++) { |
5 | if (array[i] > val) { |
6 | val = array[i]; |
7 | idx = i; |
8 | } |
9 | } |
10 | ret idx; |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035925 |
Snippet name: | indexOfHighest |
Eternal ID of this version: | #1035925/1 |
Text MD5: | 49428da858c80c27a347261e9cf92e0b |
Transpilation MD5: | dbdac08f2b84645e90af72dcd0c95ed0 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-14 19:46:28 |
Source code size: | 238 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 128 / 174 |
Referenced in: | [show references] |