fork download
  1. function f(s)
  2. c=char(strsplit(s,[10 '']));[~,i]=sort(c>32);[m,n]=size(c);c(i+repmat((0:n-1)*m,m,1))
  3.  
  4. end % this is only needed in the online interpreter to separate function from interpreter commands
  5.  
  6. s = ['Programming' 10 'Puzzles' 10 '&' 10 'Code' 10 'Golf'];
  7. f(s)
Success #stdin #stdout 0.17s 65136KB
stdin
Standard input is empty
stdout
ans =

P          
Prog       
&uzz       
Coderam    
Golflesming