Draft

Print a Matrix in Spiral Form

Description:

Problem

Give a matrix, print values in a counter-clockwise spiral form from upper left corner of the matrix.

Only single character will be given as element. You do not need to verify the edge cases of input.

Sample test case

spiral_print([
  ['a','b','c','d'],
  ['e','f','g','h'],
  ['i','j','k','l']
  ]) # -> 'aeijklhdcbfg'

spiral_print([
  ['a','b','c','d']
  ]) # -> 'abcd'
Algorithms
Arrays

Similar Kata:

More By Author:

Check out these other kata created by msg7086

Stats:

CreatedOct 18, 2014
Warriors Trained143
Total Skips30
Total Code Submissions85
Total Times Completed26
Ruby Completions26
Total Stars3
% of votes with a positive feedback rating67% of 12
Total "Very Satisfied" Votes8
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes4
Total Rank Assessments14
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • msg7086 Avatar
Ad