Skip to main content
2 of 4
added 622 characters in body
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt -Rx, 20 18 bytes Nc¡=ä+ Ëq' ² iEç'

Try it


##Explanation :Implicit input of array U N :The array of inputs (NOT the input array) c :Concatenate ¡ : Map U ä+ : Consecutive sums of U = : Reassign to U for next iteration \n :Reassign the result 2D-array to U Ë :Map each array at index E q : Join with '\t : Tab ² : Repeated twice i : Prepend '\t : Tab ç : Repeated E : E times :Implicitly join with newlines, trim (not strictly necessary) and output.

Shaggy
  • 43.5k
  • 4
  • 36
  • 94