DEV Community

Discussion on: Find Numbers with Even Number of Digits from leetcode

Collapse
 
imjoshellis profile image
Josh Ellis

Good work.

Some optimizations:

If the goal is to return the length of arr at the end, it’s simpler (and less memory) to increment a count number variable rather than pushing to arr.

You also don’t need to reset temp as it will be reset each time the for block loops.