On Tuesday, 15 June 2021 at 07:41:06 UTC, jfondren wrote:
On Tuesday, 15 June 2021 at 06:39:24 UTC, seany wrote:
[...]

add a `writeln(c.length);` in your inner loop and consider
the output. If you were always pushing to the end of c, then
only unique numbers should be output. But I see e.g. six
occurrences of 0, four of 8 ...

[...]

My attempt is to make such huge O(N^4) or O(N^5) algorithms faster.

Wouldn't all these calculation of unique `i` make the program slow? I would like to know how to do this properly.

Reply via email to