Back to Browse

Solving Hackerrank's Diagonal Difference Problem Using JavaScript

7.8K views
Feb 20, 2019
9:05

In today's video, we discuss how to go about solving the 'diagonal difference' algorithm problem on hackerrank.com To be more specific, we focus on writing a for loop with has more than one iterators. note: for the last return statement, instead of using the if statement to return a positive number, a more convenient way would be using the Math.abs() method to convert the `sum` to its absolute value.

Download

1 formats

Video Formats

360pmp412.0 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Solving Hackerrank's Diagonal Difference Problem Using JavaScript | NatokHD