fork download
  1. f={[it].collectNested{it in String?" "*it.size():0}[0]}
  2.  
  3. [7,
  4. 123.456,
  5. "X",
  6. " ",
  7. "Yo!",
  8. [],
  9. [-1.2E3],
  10. ["Hey"],
  11. ["H","e","y"],
  12. ["R",2,"D",2],
  13. ["C","3","P",0],
  14. ["THX",[1138]],
  15. ["T","H","X",[1138]],
  16. [[["H"],"e",1,1,0],[[-3],"arth"]]].each{println f(it)}
  17.  
Success #stdin #stdout 0.59s 332864KB
stdin
Standard input is empty
stdout
0
0
 
  
   
[]
[0]
[   ]
[ ,  ,  ]
[ , 0,  , 0]
[ ,  ,  , 0]
[   , [0]]
[ ,  ,  , [0]]
[[[ ],  , 0, 0, 0], [[0],     ]]