+ 2
Challenge: Arranging the matrix elements.
Given an input eg. {1,2,3,4,5,6,7,8,9} The output should be like- 1 3 6 2 5 8 4 7 9 Any language. One can consider a 3 x 3 matrix for instance. But the best answer would be a N x N program.
20 Réponses
+ 2
And Heres my Answer##
(includes default / sample inputs)
JUST RUN AND WATCH
#####BONUS==>>
(( works with rectangular matrix too like m×n....Default is set as m=n [means square mtrx] ))
https://code.sololearn.com/caXXAQCLsoU5/?ref=app
+ 2
I will work on this after work, I actually have a very similar code that does almost the same thing if you want to check it out
https://code.sololearn.com/c6NSydL4yhF9/?ref=app
+ 2
Great coding guys! as expected 😎@sayan chandra
and i loved😍 that Zig-Zag matrix too!@Vari93
Didn't expect the results so early😁 Thanks for the Bonus😄
+ 2
the is my simple code
https://code.sololearn.com/c7hcEZgFfian/?ref=app
0
Take any random input from user like
8 4 5 2 1 3 6 7 9
and output
8 5 3
4 1 7
2 6 9
You see it has a pattern! How'd you loop this!