Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAHi, Here's my solution, which is i think more efficient in terms of space and time complexity. Because it generates less rows compared to append fields or generating all the dividends. It is able to generate not only 0-50 but more than that, efficiently. It can generate prime numbers from 0-10000 by 1 second.
My solution attempts to be efficient with O(n log n). I avoided the append tool because on a bigger scale, if used, performance will be O(n^2) because it would generate n x n rows, more than is necessary to solve this.
Generating the numbers from 2 to n is just O(n) and seems unavoidable.
But the second generate rows tool creates the minimal number of divisors to figure this out.
Math challenges are always fun 🙂
#187
Looking forward to seeing the different ways people solved this problem!