Hello, I'm trying to port java logic to rust and stumbled at this piece of logic and couldn't figure out what is equivalent rust code for this. Can you please help how will I make this work with idiomatic rust ??
private int subarraySum(int[] arr) {
int result = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = i; j < arr.length; i++) {
for (int k = i; k <= j; k++) {
result += arr[k];
}
}
}
return result;
}