0

SUM UP THE ALL INTEGER IN THE NESTED ARRAY LIST

What is the difference between these two functions. They both have the same algorithm but different output. Although I used return statement in the first function, while I print the second function out. Could there be any logic behind this? If there is, can someone please explain https://code.sololearn.com/Wbc8mGwye0Si/?ref=app

2nd Feb 2021, 7:01 PM
Ibrahim Yusuf
Ibrahim Yusuf - avatar
2 Antworten
+ 4
the algorithm used is qualified as 'recursive', meaning that it call itself to resolve... so it requires that it return the result to work properly (you could log result if you want, but you need to return result or modify algorithm to make it linear^^)
2nd Feb 2021, 7:11 PM
visph
visph - avatar
0
Thank You visph, now everything make sense.
3rd Feb 2021, 1:59 AM
Ibrahim Yusuf
Ibrahim Yusuf - avatar