• + 0 comments

    Great solution! Your runtime is O(n + m) though, not O(n). Since m can be much bigger than n, it does make a difference.