I am trying to get the index of the lowest value in a array/ArrayList. How do I do this?
I have an array of length 4(which I can make an ArrayList if that would be easier), and I need to find the index of the lowest value in the array, to remove that same index from an ArrayList.
17 Replies
⌛
This post has been reserved for your question.
Hey @blockgoblin31! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
no it isnt
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
like this?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
thats what I thought I was doing(except the traditional for loop part)
I was going through each value in the array, checking if it was lowest so far, and if so saving it
then at the end getting the index of that in the list
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
the last line is getting that, with stats.indexOf(temp)
at least I thought
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes, I'm getting the index of that value
with .indexOf
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
cool thanks
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@501514065068294154>.