'Python backwards for loop converted into java, not working

I am so triggered by this. I am rewiriting a piece of python code into java. And my program has not been working. I have just found out why. It is the backwards for loop!

Python

for i in range(len(array) - 1, 2, -2): 

MY written in java

for (int i = diff.size() - 1; i < 2; i = i - 2) {}

I've been pulling my hair out. Does anyone know what is wrong??!!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source