We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Warmup
- Diagonal Difference
- Discussions
Diagonal Difference
Diagonal Difference
Sort by
recency
|
5825 Discussions
|
Please Login in order to post a comment
int left = 0; int right = 0 ; int indexRight = arr.Count();
Solution in Golang
var sumLeft, sumRight int32 for i, j := 0, 1; i < len(arr) && j <= len(arr); i, j = i+1, j+1{ sumLeft = sumLeft + arr[i][i] sumRight = sumRight + arr[i][len(arr)-j] } return int32(math.Abs(float64(sumLeft) - float64(sumRight))) }
could you please tell me how to understand the question
import java.io.; import java.math.; import java.security.; import java.text.; import java.util.; import java.util.concurrent.; import java.util.regex.*;
class Result {
}
public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
}