Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    1424 - Diagonal Traverse II\.

    Medium

    Given a 2D integer array nums, return all elements of nums in diagonal order as shown in the below images.

    Example 1:

    Input: nums = \[\[1,2,3],4,5,6,7,8,9]

    Output: 1,4,2,7,5,3,8,6,9

    Example 2:

    Input: nums = \[\[1,2,3,4,5],6,7,8,9,10,11,12,13,14,15,16]

    Output: 1,6,2,8,7,3,9,4,12,10,5,13,11,14,15,16

    Constraints:

    • <code>1 <= nums.length <= 10<sup>5</sup></code>

    • <code>1 <= numsi.length <= 10<sup>5</sup></code>

    • <code>1 <= sum(numsi.length) <= 10<sup>5</sup></code>

    • <code>1 <= numsj<= 10<sup>5</sup></code>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final IntArray findDiagonalOrder(List<List<Integer>> nums)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait