Back to course home
0% completed
Vote For New Content
in the while loopwhile (product >= target && left < arr.length)why is left boun...
Shannon Wang
Apr 25, 2022
in the while loop while (product >= target && left < arr.length) why is left bound by arr.length? shouldn't it be left < right?
4
0
Comments
Comments
R
Richard Yuan3 years ago
Is having left < arr.length necessary? When left is at the last element, the product will have become 1 and we will no longer satisfy the while loop condition.
On this page