loading...

re: Solving "Sum All Numbers in a Range" / freeCodeCamp Algorithm Challenges VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi Viren, Thanks for sharing! Just want to ask why not just add numbers in for loop. Like below let sum = 0; for (let i = arr[0]; i <= a...
 

No. There is no problem in your methodology. But I think you assumed that arr[0] <= arr[1] ? Have your read description carefully?

code of conduct - report abuse