Home
Learning
JAVA
Best Java Book's
Interview Preparation
Question asked On Array
String
Try_Catch
OOPS
Static
Solid Principal
Privacy
AboutUS
Contact US
Home
»
calculate the absolute difference between the sums of its diagonals.
,
Diagonal Difference
» Calculate the absolute difference between the sums of its diagonals.(Hacker Rank Problem )
Calculate the absolute difference between the sums of its diagonals.(Hacker Rank Problem )
Shiv Kumar Rawat
6:48 AM
No comments
Diagonal Difference
Solution
public
static
int
diagonalDifference
(
List
<
List
<
int
>>
arr
)
{
int
d1
=
0
,
d2
=
0
;
int
count
=
arr
.
Count
;
for
(
int
i
=
0
;
i
<=
arr
.
Count
-
1
;
i
++)
{
for
(
int
j
=
0
;
j
<=
arr[i]
.
Count
-
1
;
j
++)
{
if
(
i
==
j
)
{
d1
+=
arr
[
i
][
j
];
}
if
(
i
==
count
-
j
-
1
)
{
d2
+=
arr
[
i
][
j
];
}
}
}
return
Math
.
Abs
(
d1
-
d2
);
}
Share:
Email This
BlogThis!
Share to X
Share to Facebook
Share to Pinterest
Shiv Kumar Rawat
Hi Friends, I am Shiv Kumar Rawat, Post Graduate In Computer Science and having 5 year of experience in IT industries as a software developer
← Newer Post
Older Post →
Home
No comments:
Post a Comment
Popular
Tags
Blog Archives
Popular
EY company interview questions on RPA with .Net profile
Hi Friends I am sharing my experience. RPA: 1. How we use Rest API in AA. 2. How to use .net DLL in AA. 3. How to fetch Ex...
Automation Anywhere interview at Wipro 2019
Hi friends! I am sharing some AA interview questions asked in Wipro. 1. Tell me about your project. 2. How many process ...
Count number of similar element of an array in Pair using C#
Problem John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of int...
Tags
shiv kumar rawat
(5)
Automation Anywhere Interview Questions UiPath Interview Questions Blue Prism Interview Questions
(4)
#String #.Net
(3)
.net interview
(3)
technicalrawatg
(3)
For loop in java
(2)
Hacker Rank Solution
(2)
Loops In Java
(2)
Loops PPT Download
(2)
Statement in java
(2)
java loop ppt
(2)
while loop in java
(2)
# shiv Kumar Rawat
(1)
1
(1)
13
(1)
2
(1)
21
(1)
3
(1)
5
(1)
8
(1)
Apple_Orange Problem Solution (Hacker Rank)
(1)
Array In C#
(1)
Array Interview questions
(1)
Array Programe
(1)
Array Sorting
(1)
Au
(1)
C#
(1)
C# Interview
(1)
C# Interview Question
(1)
Count All Distinct Pairs with a difference equal to k. 1 repetition is allowed
(1)
Count duplicate characters from String?
(1)
Count number of similar element of an array in Pair using C#
(1)
Diagonal Difference
(1)
Download PPT of java operator
(1)
Grading Students
(1)
How to Count no of repeated character in a String?
(1)
How to Find out Given 2 String is anagram or Not ?
(1)
How to count a number of vowels and consonants in a String?
(1)
How to find all possible substring of a given string?
(1)
How to find largest and smallest No in unsorted array
(1)
How to find out the reverse of an array
(1)
How to reverse a string?
(1)
How to use Filmora without watermarks
(1)
JAVA Data type
(1)
JSR Techno talk's
(1)
PPT
(1)
PRINT Fibonacci series 0
(1)
Palindrome
(1)
RPA
(1)
Remove duplicate characters from String?
(1)
String
(1)
Try Catch block
(1)
UHG Interview question For RPA & .Net Profile
(1)
abstract class
(1)
array
(1)
calculate the absolute difference between the sums of its diagonals.
(1)
shiv kuamr
(1)
Blog Archive
▼
2019
(52)
►
August
(3)
▼
July
(15)
Essential C# interview questions and answers on St...
How do you check if a given string is a palindrome?
How can a given string be reversed using recursion?
How do you count the occurrence of a given charact...
Kangaroo jump problem Solution (Hacker Rank)
Apple and Orange Problem Solution (Hacker Rank)
Merge two array and store them into another array ...
How to find out the reverse of an array
How to find largest and smallest No in unsorted array
Determine if any two integers in array equal to su...
How to count the occurrence of no of char in a str...
Grading Students - Hacker Rank Solution
How to Find out special char ‘_’ in a string and c...
Calculate the absolute difference between the sums...
How to Count no of repeated character in a String?
►
June
(12)
►
May
(3)
►
February
(19)
Mobile
Recent Posts
No comments:
Post a Comment