#Would this method work
13 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @manic cove! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
list.remove accepts index or object ,so i create max and min as Object,
it's work
create max and min as Integer
It won't work if the array contains negative numbers
(also, there is the theoretical case of an array with only one element. I suppose there is also the case of an empty array)
(while we're at it, not sure what's the point of list.stream().toList())