Java “compress” values of array, preserve relative ordering

前端 未结 0 1203
花落未央
花落未央 2021-02-20 05:46

I need to turn an N-size array with possibly large (or negative values) to only contain the numbers 0...N-1, preserving relative order. For example, {10, 25, 20, 20} should beco

相关标签:
回答
  • 消灭零回复
提交回复
热议问题