This repository consists of the code samples, assignments, and notes for the Java data structures & algorithms + interview preparation bootcamp of WeMakeDevs.
The previous loop was iterating one more time than it needed to. N - 1 elements implies that iterator i should go only upto index of second last element, which is arr.length - 1
The previous loop was iterating one more time than it needed to. N - 1 elements implies that iterator
i
should go only upto index of second last element, which isarr.length - 1