Answers for "diagonal difference in java"

0

diagonal difference in java

int leftd=0;
    int rightd=0;
    int n=arr.size();
    for(int i=0;i<n;i++)
    {
        leftd+=arr.get(i).get(i);
        rightd+=arr.get(i).get(n-i-1);
    }
    int absd=Math.abs(leftd-rightd);
    return absd;
Posted by: Guest on May-08-2021

Code answers related to "diagonal difference in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language