Skip to content

Instantly share code, notes, and snippets.

@vandewilly
Created August 17, 2017 16:11
Show Gist options
  • Save vandewilly/61ca9bb44f48a844cf4f9feb3b4ad573 to your computer and use it in GitHub Desktop.
Save vandewilly/61ca9bb44f48a844cf4f9feb3b4ad573 to your computer and use it in GitHub Desktop.
Suppose you have a matrix in the form of a 2 dimensional array.
Write a method to read the rows of the matrix alternatively from right to left, left to right so on and return them as a 1 dimensional array.
for eg:
1 2 3
4 5 6
7 8 9
should return 1 2 3 6 5 4 7 8 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment