Shuffel array such that the expected index of an element will be its original index

前端 未结 0 1916
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 21:13

consider an array:

a=[0,1,2,3,4,5,6,...99]

I\'d like to shuffel it so that the expected element to end up in the 0th position is 0, in the 1s

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