Given a square matrix, calculate the absolute difference between the sums of its diagonals.
For example, the square matrix arr is shown below:
Given a square matrix, calculate the absolute difference between the sums of its diagonals.
For example, the square matrix arr is shown below:
Calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large.
Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories: problem clarity, originality, and difficulty.
We define the rating for Alice’s challenge to be the triplet a = (a[0], a[1], a[2]), and the rating for Bob’s challenge to be the triplet b = (b[0], b[1], b[2]).
Your task is to find their comparison points by comparing a[0] with b[0], a[1] with b[1], and a[2] with b[2].
Given an array of integers, find the sum of its elements.
For example, if the array ar = [1, 2, 3], 1 + 2 + 3 = 6, so return 6.
Update your browser to view this website correctly. Update my browser now