Can somebody explain me what does this algorithm do?

What is the language @lelolo88 ?

It’s just a description of an algorithm @AndrewAung11 , it can be implemented in any language, it isn’t written in one here (well, technically it is, it’s in English).

Have you tried replacing A with an array of numbers and seeing what the result is @lelolo88? And what is this from, because there’s no context (is A any array of numbers? Or do they have to be specific types of numbers? Or in some order? Etc)

1 Like

Can you describe where it gets confusing for you @lelolo88 ? A perfectly good approach to starting to understand an algorithm is to run through some test inputs with pen and paper. Have you tried doing that?

You could also try translating it to a programming language that you know and see if it’s easier for you to read that way.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.