• + 1 comment

    The initialization of Counter need to read the whole list. So it may not able to beat the simple iteration solution. Did you test it yet?