What should the output for n other than 1, 2, 5, 10, 25 and 50 be?
n
It should build n columns. Regardless if there is some remainder or not, the remainder should just be put in a column of itself (which will contain less elements compaired to the other).
You mean a row? A row where only m<n out of n columns are populated?
Hi, the function should build columns, say you have only 9 indexes and build 3 columns:
Say array is [0,1,2,3,4,5,6,7,8]
Your columns will be:
0 3 6 1 4 7 2 5 8
That's the output in the console, of course the 'columns' can be simple arrays, but the elements have to be pushed onto them like this.
Also, if instead of 9 items you have say 11 -> [0,1,2,3,4,5,6,7,8,9,10], your output will be similar but the last column will be incomplete:
0 3 6 9 1 4 7 10 2 5 8
Hope this clarifies it a bit.
Thanks for reaching out =).
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What should the output for
n
other than 1, 2, 5, 10, 25 and 50 be?It should build n columns. Regardless if there is some remainder or not, the remainder should just be put in a column of itself (which will contain less elements compaired to the other).
You mean a row? A row where only m<n out of n columns are populated?
Hi, the function should build columns, say you have only 9 indexes and build 3 columns:
Say array is [0,1,2,3,4,5,6,7,8]
Your columns will be:
0 3 6
1 4 7
2 5 8
That's the output in the console, of course the 'columns' can be simple arrays, but the elements have to be pushed onto them like this.
Also, if instead of 9 items you have say 11 -> [0,1,2,3,4,5,6,7,8,9,10], your output will be similar but the last column will be incomplete:
0 3 6 9
1 4 7 10
2 5 8
Hope this clarifies it a bit.
Thanks for reaching out =).