Bro I didn't understand what you are asking 🤔 If we initialize i=1, the we'll skip the 0th index element 🙂 The question is just asking to return in 1 based indexing format...and by default array elements are stored in 0 based indexing format So, we are just adding 1 to our answer indices to convert into 1 based format..that it ❤️
Subscribe
most important part 11:00
Thanks
Why cant we directly assign i=1 instead of later adding +1?
We have to return 1 based index
Bro I didn't understand what you are asking 🤔
If we initialize i=1, the we'll skip the 0th index element 🙂
The question is just asking to return in 1 based indexing format...and by default array elements are stored in 0 based indexing format So, we are just adding 1 to our answer indices to convert into 1 based format..that it ❤️