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

 

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

Write a method that returns an array of the same length as the 'nums' array. Each element of the new array will be the maximum digit that occurs at that same index in the 'nums' array. As a precondition you may assume that all the elements of 'nums' are positive. Look at the test data for examples.


test2025_05_22_APP1SL_maxDigit([7221, 482, 942]) → [7, 8, 9]
test2025_05_22_APP1SL_maxDigit([1111111, 111, 1, 2, 555, 124]) → [1, 1, 1, 2, 5, 4]
test2025_05_22_APP1SL_maxDigit([456, 9218, 346, 244, 463, 1111, 2245, 7842]) → [6, 9, 6, 4, 6, 1, 5, 8]

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

public int[] test2025_05_22_APP1SL_maxDigit(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: 230

Copyright Nick Parlante 2017 - privacy