package com.kevinxw.coding.leetcode.problem;

import org.junit.Assert;
import org.junit.Test;

import static org.junit.Assert.assertArrayEquals;

public class Q2012_3_24Test {

    @Test
    public void testSpiralOrder() throws Exception {
        Assert.assertArrayEquals(new Integer[]{}, Q2012_3_24.spiralOrder(new int[][]{}).toArray(new Integer[0]));

        int[][] case1 = new int[][]{
                {1, 2, 3},
                {4, 5, 6},
                {7, 8, 9}
        };

        Integer[] res1 = new Integer[]{1, 2, 3, 6, 9, 8, 7, 4, 5};
        assertArrayEquals(res1, Q2012_3_24.spiralOrder(case1).toArray(new Integer[0]));
    }
}