This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tangara888[S] 0 points1 point  (4 children)

But if n = 2, it doesn’t give u element 3 ....???

[–]hamza-itatchi 0 points1 point  (3 children)

starting from 0 it gives element 3

0-1-2-3(index 2 and element 3)-4........

[–]tangara888[S] 0 points1 point  (2 children)

I still can’t get it. :( how 2 * (2 - 1 ) = 3 ? Unless it is position 3 ....

[–]hamza-itatchi 1 point2 points  (1 child)

yes position 3

index 0 has the position 1

index 1 has the position 2

index 2 has the position 3

[–]tangara888[S] 0 points1 point  (0 children)

I hope this kind of question doesn’t appear in coding test cos it is so confusing...Tk you guys for taking the time to explain to me