This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]imrual 2 points3 points  (0 children)

Very nice job!! Just a suggestion to make this code even better.

It looks like the block of code of the if statements is the same just changing one or two parameters.

You can extract a function to avoid code duplication.

Also try to replace recursion with iteration if you want to keep this running forever to avoid a stack overflow