about | help | code help+videos | done | prefs |
array2D_diagSums
Given a 2D array of integers (1D arrays to build a 2D array from), that is guaranteed to be 3 rows and 3 columns, return a new 1D array that is size 2, where the first value is the sum of the diagonal going from top left to bottom right, and the second value is the sum of the diagonal going from the top right to the bottom left in the 2D array. Your first two lines of code must be: int[][] arr = {row1, row2, row3}; int[] diagSums = new int[2]; array2D_diagSums([1, 1, 1], [2, 2, 2], [3, 3, 3]) → [6, 6] array2D_diagSums([1, 2, 3], [5, 5, 5], [1, 3, 4]) → [10, 9] array2D_diagSums([1, 1, 2], [1, 1, 1], [1, 1, 5]) → [7, 4] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy