AddUnique returning a lot of 0s

Hi there.

I have been having issues with a task I am trying to complete.

The task is to

  • Receive an array of 100 integer variables which are randomly generated.
  • Return values as output log.
  • Array has unique random number (no doubled values)
  • Return value & index of highest and lowest numbers.

The issue I am having is that the array is printing out a ton of 0s when I print it out, and my lowest Min value is always 0, and Highest Max value is always 999. Here is what my blueprint looks like so far

When you call Resize on WorkArray, it fills the array with 100 zeros.

After that, you iterate the array (100 zeros) and add new items while iterating! Each new item you add will be iterated as well, so you end up adding much much more than expected.

Here is a better way to fill your array :

Just be careful to have a bigger range than the desired length or it will loop infinitely.

Thank you!