id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us introtoarrays > findMaxIndex
prev  |  next  |  chance

Write a method that returns the INDEX of the maximum value found in the array. The array will contain at least one element. If there is a tie for the maximum value, return the INDEX of the FIRST occurance of the maximum value.


findMaxIndex([4, -5, 6, 20, -40, 10, 3, 0]) → 3
findMaxIndex([8, 8, 8, 8]) → 0
findMaxIndex([-7, -3, 0, -2]) → 2

...Save, Compile, Run (ctrl-enter)

public int findMaxIndex(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 420

Copyright Nick Parlante 2017 - privacy