Ad
  • Custom User Avatar

    It really depends on your logic. Not all ways of doing this add both divisors to the array. i.e. when getting factors of 72 and you are testing 2, not all algorithms will also add 36 in the same iteration. If you take a functional approach such as filtering a range of 2..x, x needs to be the initial input divided by 2. If you are looping and adding both divisors, then square root works fine.

  • Custom User Avatar

    Got this output, need some help

    Expected: '[3, 5]', instead got: '3'