Ad
  • Custom User Avatar

    yes "Best Practice"

    1. on else if 'l < w' not 'l > w'
    2. addAll fails on NullPointer - needs condition with add 'w' if result is null
    3. for zero and negative input crash with StackOverflow
    4. what's happend if imput is valid but big number? Yes, StackOverflow again!
    5. as a bonus is thousand times slower than solution without recursion

    This is too many issues in few lines of code.