How efficient is this algorithm?

I know that blueprints are not efficient at all compared to C ++, but on the downside I want to try to optimize the algorithm as much as possible.

And thank you for the link!