For Loop with condition

for(j=i-1;j>=0;j--)
how to write in rust?
i try it like:
for j in (0..i-1).rev()
but it will not give the desire output

I think that C code is equivalent to (0..i).rev(). I.e. it is the same indices as 0..i, but reversed.

4 Likes

I got it thanks