0
public static int diagonalDifference(List<List<Integer>> arr) {
// Write your code here

}

what does this function parameter actually mean 2D list or what

i'm just trying to make a something that calculate the sum of a diagonal of numbers

  • 2
    *actually mean 2D list* - yes – Scary Wombat Jun 30 '23 at 01:00
  • to be precise it's a jagged array, not a rectangular 2D array like a matrix – phuclv Jun 30 '23 at 01:04
  • 2
    It's a list of lists. – shmosel Jun 30 '23 at 01:22
  • 1
    In this specific case, it's how HackerRank chose to specify a square matrix of integers as the API for solving the [Diagonal Difference](https://www.hackerrank.com/challenges/diagonal-difference/problem) problem. The outer `List` are the rows, and each row is a `List` of the columns in that row. – Bohemian Jun 30 '23 at 01:37

0 Answers0