Skip to main content
1 of 2
Steve Bunting
  • 1.1k
  • 1
  • 7
  • 18

Your problem is with the following line:

values = result;

You can not assign every value from one array into another with a one-line statement like this. In order to change the array 'haystack', the sorted values needs to be put back into the values array. I believe the best way to do this is with another for loop.

Steve Bunting
  • 1.1k
  • 1
  • 7
  • 18