Recursive Digit Sum

  • + 1 comment

    then why the hell we are getting time error when using for loop but not when using streams :(

    • + 0 comments

      @Singhalr31 For a simple "for" loop (without Collections or Maps), Java 8 Stream "could be" overkill. If you need to iterate over a "LARGE" Collection (or Map) , however, Java 8 may be faster because you could avoid creating LOTS of "intermediate" Objects by simply streaming data in the Collection from one operation to another.