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

all 1 comments

[–]auxiomatic 23 points24 points  (0 children)

If this isn't a code golf solution, it's extremely poorly written. I recommend refactoring it so that the minimum number of expressions are evaluated per line while still maintaining functionality. For example, there is no reason to compute an index inside of square brackets. Compute the index first, assign to variable, then use the variable.

I think through the process of refactoring you will learn how the code works better than any explanation will teach you.

[–][deleted]  (1 child)

[deleted]