Why cant we directly assign i=1 instead of later adding +1?
@crazyyyz587724 күн бұрын
We have to return 1 based index
@CodeGenius31623 күн бұрын
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 ❤️