You are viewing a single comment's thread. Return to all comments →
arr = [2,4,2,6,1,7,8,9,2,1]
ans = 1,2,1,2,1,2,3,4,2,1
I dont understand where we get 3 and 4 out of no where? ok 4 is more + 1 than 3, but why 3? and why start at 8? why not 2,6 get 3 and 4 ?
Seems like cookies are disabled on this browser, please enable them to open this website
Candies
You are viewing a single comment's thread. Return to all comments →
arr = [2,4,2,6,1,7,8,9,2,1]
ans = 1,2,1,2,1,2,3,4,2,1
I dont understand where we get 3 and 4 out of no where? ok 4 is more + 1 than 3, but why 3? and why start at 8? why not 2,6 get 3 and 4 ?