0

I am trying to sort these 2 arrays in Java:

new int[]{15, 15, 26, 46}, //value

new int[]{50, 20, 15, 25}, //quantity

I want them to be sorted by value from lowest to highest but if they have the same value I want them to be sorted by quantity then the one with lower quantity will go first, with that in mind I am expecting this result:

{2,1,3,4}
Community
  • 1
  • 1
Oslon
  • 1
  • 1

0 Answers0