Skip to content

Commit

Permalink
Print A Given Matrix in Spiral Form - Program
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoaib Rayeen authored Jul 4, 2019
1 parent cdf261f commit 57b142f
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Given a 2D array, print it in spiral form. See the following examples.
```
Input:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output:
1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10
Input:
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
Output:
1 2 3 4 5 6 12 18 17 16 15 14 13 7 8 9 10 11
```

0 comments on commit 57b142f

Please sign in to comment.