Skip to main content
Commonmark migration
Source Link

Japt -Rx, 20 18 bytes

#Japt -Rx, 20 18 bytes TheThe second line includes a trailing tab.

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 resulting 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.

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 resulting 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.

#Japt -Rx, 20 18 bytes The second line includes a trailing tab.

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 resulting 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.

Japt -Rx, 20 18 bytes

The second line includes a trailing tab.

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 resulting 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.
added 44 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt -Rx, 20 18 bytes Nc¡=ä+ Ëq' ² iEç'The second line includes a trailing tab.

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 resultresulting 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.

#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.

#Japt -Rx, 20 18 bytes The second line includes a trailing tab.

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 resulting 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.

added 622 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

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

Try itTry it


##Explanation :Implicit input of array U N :The array of inputs (NoteNOT the input array) c : uses spacesConcatenate ¡ : Map U ä+ : Consecutive sums of U = : Reassign to U for now as my phone's keyboard doesn't have a tab key! Will updatenext iteration \n :Reassign the result 2D-array to U Ë :Map each array at index E q : Join with tabs '\t : Tab ² : Repeated twice i : Prepend '\t : Tab ç : Repeated E : E times :Implicitly join with newlines, trim (not strictly necessary) and an explanation, when I get back to a computeroutput.)

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

Try it (Note: uses spaces for now as my phone's keyboard doesn't have a tab key! Will update with tabs, and an explanation, when I get back to a computer.)

#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.

Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading