• + 0 comments

    Nice job. You might want to try improving the runtime by only iterating up to the square root of n instead of n like this to improve your runtime from O(n) to O(n^(1/2)).

    Hope this helps.

    HackerRank solutions.