| Bytes | Lang | Time | Link |
|---|---|---|---|
| 026 | AWK | 250908T163931Z | xrs |
| 003 | Thunno 2 N | 230623T165152Z | The Thon |
| 005 | Japt P | 221017T094805Z | Shaggy |
| 008 | Brachylog v1 | 161219T134923Z | Fatalize |
| 005 | Vyxal | 221017T093314Z | DialFros |
| 007 | Brachylog v2 | 220101T212016Z | ais523 |
| 011 | Keg | 200126T131815Z | user8505 |
| 012 | GolfScript | 200126T124945Z | user8505 |
| 003 | W j f | 200126T124051Z | user8505 |
| 099 | Java | 170328T195317Z | user6333 |
| 020 | Stacked | 170328T192645Z | Conor O& |
| 048 | Octave | 161219T151829Z | rahnema1 |
| 025 | QBIC | 161219T164811Z | steenber |
| 057 | Clojure | 170111T005015Z | NikoNyrh |
| 074 | Clojure | 161225T053053Z | Carcigen |
| 034 | Ruby | 161223T230743Z | Seims |
| 005 | Jelly | 161219T135111Z | Erik the |
| 059 | Python | 161219T173140Z | Sherlock |
| 017 | brainfuck | 161221T185206Z | Milihhar |
| 141 | Java | 161222T121318Z | user4490 |
| 074 | Python 3 | 161219T132756Z | Sygmei |
| 052 | C | 161220T223356Z | Steadybo |
| 080 | Python | 161220T181110Z | Riker |
| 033 | PHP | 161219T133045Z | Xanderha |
| 054 | C89 | 161219T144753Z | cat |
| 037 | JavaScript ES6 | 161219T132751Z | Arnauld |
| 049 | PHP | 161220T124142Z | Dexa |
| 008 | Actually | 161219T151259Z | Teal pel |
| 016 | V | 161219T133547Z | user4180 |
| 022 | Retina | 161219T154448Z | Martin E |
| 021 | Perl | 161219T133839Z | Dom Hast |
| 054 | Mathematica | 161220T004621Z | Greg Mar |
| 034 | Pure bash | 161219T185351Z | Digital |
| 068 | Batch | 161220T011517Z | Neil |
| 006 | 05AB1E | 161220T010715Z | Oliver N |
| 069 | bash | 161219T183906Z | Mitchell |
| 058 | Python 2 | 161220T000512Z | AvahW |
| 011 | MATL | 161219T161718Z | Luis Men |
| 051 | Python 2 | 161219T191923Z | Mitch Sc |
| 067 | GeoGebra | 161219T150526Z | TheBikin |
| 044 | R | 161219T145059Z | JAD |
| 022 | Scala | 161219T165143Z | corvus_1 |
| 035 | Haskell | 161219T163806Z | nimi |
| 053 | JavaScript | 161219T152220Z | Oliver |
| 022 | Perl 6 | 161219T151737Z | smls |
| 014 | GolfScript | 161219T154714Z | Erik the |
| 065 | C# | 161219T130919Z | Alfie Go |
| 068 | Python 2 | 161219T151851Z | mbomb007 |
| 036 | Mathematica | 161219T153147Z | Martin E |
| 041 | PowerShell | 161219T153023Z | AdmBorkB |
| 010 | APL | 161219T151629Z | marinus |
| 065 | C# | 161219T144517Z | adrianmp |
| 013 | CJam | 161219T141934Z | Erik the |
| 007 | Pyth | 161219T141458Z | TheBikin |
| 006 | 05AB1E | 161219T135326Z | Adnan |
| 008 | Pyth | 161219T135154Z | user4854 |
| 065 | GameMaker Language | 161219T132730Z | Timtech |
| 006 | 05AB1E | 161219T131252Z | Emigna |
Japt -P, 5 bytes
õõ cÔ
õõ cÔ :Implicit input of integer
õ :Range [1,input]
õ :Range [1,each], giving a 2D-array
c :Flatten after
Ô :Reversing each
:Implicitly join & output
Brachylog v1, 8 bytes
yb@[rcw\
Explanation
yb The list [1, ..., Input]
@[ Take a prefix of that list
rc Reverse it and concatenate into an integer
w Write to STDOUT
\ Backtrack: try another prefix
Vyxal, 5 bytes
ɾɾRṅṅ
Tied with first :(
Explained
ɾɾRṅṅ
ɾɾ # range of range of [1...input]
R # reduce (reverse each of list)
ṅṅ # join by nothing twice
Brachylog (v2), 7 bytes
⟦₁⟧₁ᵐcc
Function submission. (The TIO link contains a command-line argument to run a function as though it were a full program.)
This would be just five bytes if the sequences went down to 0 rather than 1 – so it seems that this is one of those questions that's decided by the choice of 0- versus 1-indexing.
Explanation
⟦₁⟧₁ᵐcc
⟦₁ Range from 1 to {the function input}
ᵐ On each element of that range,
⟧₁ take a descending range from that value to 1
c Concatenate the ranges
c Concatenate the digits of the resulting numbers
W j f, 3 bytes
It's actually pretty trivial in W ...
M_M
Explanation
a % Take an input, say 3
M % Identity map every item in numeric value 3
% Since it is prohibited, a range is generated,
% namely [1 2 3]
a M % For every item in [1 2 3]:
% Note that single items are 1, 2, and 3, *not* the whole list
a % Generate a range from 1 to that number: [[1] [1 2] [1 2 3]]
_ % Reverse for lists: [[1] [2 1] [3 2 1]]
Flag:f % Flatten the list: [1 2 1 3 2 1]
Flag:j % Join the list: 121321
```
Java, 99 bytes
void f(int a){int[]f=new int[2];while(++f[0]<=a){f[1]=f[0];while(f[1]>0)System.out.print(f[1]--);}}
EDIT 1: Saved few bytes by changing it from a full program to a function.
Ungolfed:
void f(int a) {
int[] f = new int[2];
while (++f[0] <= a) {
f[1] = f[0];
while (f[1] > 0) System.out.print(f[1]--);
}
}
Stacked, noncompeting, 20 bytes
~>~>reveach flat''#`
I think a few of the features used in this answer were made after this challenge.
Explanation
~>~>reveach flat''#`
~> range from [1, n]
~> vectorized range [[1,1], [1,2], ..., [1, n]]
reveach reverses each segment
flat flatten
''#` join by nothing
Octave, 47 48 bytes
@(n)num2str((g=meshgrid(n:-1:1)')(g<=1:n)','%d')
Explanation:
meshgrid(n:-1:1)' :create a grid of repeated n:1
6 6 6 6 6 6
5 5 5 5 5 5
4 4 4 4 4 4
3 3 3 3 3 3
2 2 2 2 2 2
1 1 1 1 1 1
(g<=(1:n)) :only select those elements that are under anti-diagonal
0 0 0 0 0 1
0 0 0 0 1 1
0 0 0 1 1 1
0 0 1 1 1 1
0 1 1 1 1 1
1 1 1 1 1 1
QBIC, 25 bytes
:[a|[b,1,-1|A=A+_t!c$|}?A
Sample run:
Command line: 10
12132143215432165432176543218765432198765432110987654321
Explanation:
: Get 'a' from the command line
[a| FOR b=1; b<=a; b++
[b,1,-1| FOR c=b; c>=1; c--
A=A+_t!c$| Append c to the 'output buffer' A$
} Close the FOR loops
?A Print 'a'
Non-competing: five minutes ago, I taught QBIC to do implicit printing on exit of anything stored in Z$. That brings the code for this challenge down to 22 bytes 19 bytes since I've made the cast-to-string autotrim!
:[a|[b,1,-1|Z=Z+!c$
Clojure, 57 bytes
#(apply str(reductions(fn[s i](str(inc i)s))""(range %)))
reductions is perfect for incrementally producing outputs like this.
Clojure, 94 84 74 bytes
-10 bytes by eliminating the redundant for.
-10 bytes by eliminating the let.
Still long, but -20 bytes is nice.
#(loop[r 1 a""](if(> r %)a(recur(inc r)(str a(apply str(range r 0 -1))))))
Generates the reversed range, and concats it to the accumulator, then loops again while necessary.
Ungolfed:
(defn negative-order [n]
(loop [r 1
a ""]
(let [s (apply str (range r 0 -1))]
(if (> r n)
a
(recur (inc r) (str a s))))))
Ruby, 37 34 bytes
->n{a=p;(1..n).map{|i|p a=[i,a]}*''}
Saved 3 bytes thanks to G B.
Jelly, 5 bytes
RRUVV
I suspect there is too much going on here...
[ANSWER ACCEPTED] I'd have given some 5 rep to Dennis, but this is not Reputation Exchange. Dennis showed me the VV behavior. To my surprise, this is shorter than 05AB1E.
Python, 63 57 59 bytes
A recursive solution that works in both Python 2 and 3. This can probably be golfed further. Golfing suggestions welcome! Try it online!
Edit: -6 bytes thanks to Jonathan Allan. +2 bytes with thanks to mbomb007 for pointing out a problem with my answer.
f=lambda n:n and f(n-1)+"".join(map(str,range(n,0,-1)))or""
Ungolfing
def f(n):
s = ""
for i in range(n+1):
m = map(str, range(n, 0, -1))
s += "".join(m)
return s
brainfuck, 17 bytes
>,[>[+.>]+.[<]>-]
Explanation
> keep the first cell at 0
, input of the decimal number into the cell
[> start a conditionnal loop and go to the next cell
[+.>] while it don't find 0, increment each cells and output the value
+. increment the new cell and output
[<] go to the first cell
>-] decrement the second cell and restart
Java: 141 chars
void c(int in,StringBuilder s){for(int i=1;i<=in;i++){for(int j=i;j>0;j--){s.append(Integer.toString(j));}}System.out.println(s.toString());}
Using c(6,new StringBuilder());:
121321432154321654321
Python 3, 87 92 83 74 bytes
lambda n:"".join(["".join([str(i)for i in range(1,k)][::-1])for k in range(1,n+2)])
Shorter answer using recursion :
f=lambda n:f(n-1)+"".join([str(i)for i in range(1,n+1)][::-1])if n>0else""
Maybe not the shortest one but it's only made with Python's list comprehension !
(Edited to add the print function and remove the \n)
(Edited to remove the print function, and change n+1, k+1 to n,k+2)
C, 52 bytes
Based on cat's existing answer:
i,j;f(n){j=++i;while(j)printf("%d",j--);i-n?f(n):0;}
Call with:
int main()
{
f(6);
}
Python, 80 bytes
r=''.join;lambda b:r([r([`i`for i in range(1,a+1)][::-1])for a in range(1,b+1)])
You can easily test this by pasting the above code into a repl and hitting enter, then typing _(6) or whatever input you want to give.
PHP, 35 34 33 bytes
Saved a byte because I miscounted, thanks Titus! And another!
while($i++<$argv[1])echo$s=$i.$s;
Run from command line with -r.
Pretty simple answer, loops from 1 through our input n, tacking the number onto the beginning of the string and printing it out.
C89, 54 bytes
i,j;f(n){for(i=1;j<=n;j=i++)while(j)printf("%d",j--);}
56 -2 = 54 thanks to ErikGolfer!
JavaScript (ES6), 37 bytes
f=(n,k=1)=>k>n?n--?f(n):'':f(n,k+1)+k
Demo
f=(n,k=1)=>k>n?n--?f(n):'':f(n,k+1)+k
console.log(f(6))
Alternate method for n < 10, 34 bytes (non-competing)
f=(n,s='1')=>--n?s+f(n,++s[0]+s):s
In JavaScript, strings are immutable. Therefore, it's impossible to alter the content of the Nth character of a string s by assigning a new value to s[N].
However, the expression ++s[N] is valid and does evaluate as one would expect, even if the string remains unchanged. For instance:
++"1"[0] // equals 2
And by extension:
s = "21"
++s[0] + s // equals "321"
PHP, 52 49 bytes
<?for(;$k++<$argv[1]+2;$j=$k)while(--$j>0)echo$j;
Actually 8 bytes
RR♂RΣRεj
First time posting an answer in Actually so it probably can be golfed.
How it works
Program takes implicit input, implicit print at EOF
R Takes the input and creates a range (1, input)
STACK = [1,2,..,n]
R Reverse the top stack item (our range)
STACK = [n,..,2,1]
♂R For each item in our range, create a range (1, rangeitem)
STACK = [[1,2,..,n], .., [1,2], [1]]
Σ Stitch the items of the list together
STACK = [n,..,1,2,3,1,2,1]
R Reverse the top stack item again (our answer)
STACK = [1,2,1,3,2,1,..n]
εj Create an empty string and append each item from the list to it.
(turns non string items into strings)
V, 29 28 27 23 19 17 16 bytes
8 bytes saved thanks to @DJMcMayhem
3 bytes saved thanks to @nmjcman101
"apÀñÄòy$jpkgJ
Hidden characters:
"apÀ<C-x>ñÄ<C-x>òy$jpkgJ
C-x is Ctrl+x.
Try it online! takes input via command-line arguments
Hexdump:
0000000: 2261 70c0 adf1 c418 f279 246a 706b 674a "ap......y$jpkgJ
Explanation
"ap Paste the argument
À<C-x> Argument minus 1 times (so that we exclude the 0)
ñ ... ò Loop (for some weird reason the ò closes the ñ)
Ä<C-x> paste current line above and decrement it
Now it looks like:
1
2
...
n
continued...
ò recursively do (until a breaking error)
y$ yank this line
jp paste it down
kgJ go up and join
implicit ò end
GIF (outdated)
(for arg 6)
Retina, 26 22 bytes
Byte count assumes ISO 8859-1 encoding.
.+
$*
$`¶
1
$.%'
0?¶
Explanation
.+
$*
Convert input to unary.
$`¶
At each position, insert the prefix up to that point, as well as a linefeed. This creates a unary range from 2 to n+1, one value per line.
1
$.%'
Replace each 1 with the number of characters after it on the same line. This turns something like 11111 into 43210.
0?¶
Remove all linefeeds and the zeros preceding them.
Perl, 21 bytes
Uses -E at no extra cost.
say map$}=$_.$},1..<>
Usage
perl -E 'say map$}=$_.$},1..<>' <<< 6
121321432154321654321
Mathematica, 38 54 bytes
FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&
I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). IntegerDigits converts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, and FromDigits reassembles them into an integer. Oh well.
Pure bash, 34
eval eval printf %s \\{{1..$1}..1}
Two levels of brace expansion. With input 6, the first level expands to {1..1} {2..1} {3..1} {4..1} {5..1} {6..1}. This then expands to 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 6 5 4 3 2 1, which is smushed together to one string with printf %s. eval's are required at both levels of expansion - for the first level so that the $1 parameter is expanded first, and for the second level so that it expands after the first level.
Batch, 68 bytes
@for /l %%i in (1,1,%1)do @for /l %%j in (%%i,-1,1)do @cmd/cset/a%%j
Fortunately not printing newlines only costs 5 bytes.
05AB1E, 6 bytes
LR.sJJ
Uses the CP-1252 encoding. Try it online!
# Implicit input
L # Push [1, 2, ..., n]
R # Reverse
.s # Get suffixes
JJ # Join twice
# Implicit output
bash, 69 bytes
f()([ $1 = 0 ]||(echo -n $1;f $[$1-1]));[ $1 = 0 ]||($0 $[$1-1];f $1)
f is a recursive function, and the entire script is recursive too.
Edit: @DigitalTrauma posted an improved version of this, which you can see in his comment on this answer. I'm not going to take the time to modify the answer, since he also posted a completely different bash solution, using brace expansion, that blows this answer away!
Python 2, 58 Bytes
print[[a for a in range(b+1,0,-1)]for b in range(input())]
Or, if the output of the above is not allowed, then the following code for 59 Bytes:
for i in range(input()+1):
for j in range(i,0,-1):print j,
MATL, 14 11 bytes
:"@:P]v!VXz
Explanation
: % Input N implicitly. Push range [1 2 ...N]
" % For each k in [1 2 ...N]
@: % Push range [1 2 ... k]
P % Reverse
] % End
v! % Concatenate all arrays horizontally
V % Convert to string
Xz % Remove spaces. Display implicitly
Python 2, 51 bytes
r=s=''
n=0
exec'n+=1;s=`n`+s;r+=s;'*input()
print r
GeoGebra, 67 bytes
1
InputBox[a]
Sum[Join[Sequence[Sequence[Text[j],j,i,1,-1],i,1,a]]]
Each line is entered separately into the input bar. Input is taken from an input box.
Here is a gif of the execution:
How it works
Entering 1 implicitly assigns a to 1, and the InputBox command associates an input box with a. Then, for each i in {1, 2, 3, ..., a}, the list {i, i-1, i-2, ..., 1} is created using the Sequence command, and each j in that list is converted to a string using Text. Finally, Join merges all the lists, and Sum concatenates all the elements to one text object, which is displayed.
R, 38 33 44 bytes
if((n=scan())>0)for(i in 1:n)cat(i:1,sep="")
Takes input to STDIN, and loops from 1 to n, creating the sequence i to 1 for each step and printing it.
Edit: replaced seq(i,1) by i:1 saving 5 bytes and showing why I shouldn't golf during meetings.
Scala, 22 bytes
1 to _ map(_ to(1,-1))
Returns a sequence of sequences of ints.
Usage:
val f:(Int=>Seq[Seq[Int]])=1 to _ map(_ to(1,-1))
println(f(6))
Ungolfed:
n=>1 to n map(i=>i to 1 by -1)
Explanation:
1 to _ //create a Range from 1 to the argument of this function
map( //map each element to...
_ to(1,-1) //a range from the number to 1, in steps of -1
)
Haskell, 35 bytes
f x=[1..x]>>= \y->[y,y-1..1]>>=show
Usage example: f 6 -> "121321432154321654321".
For all numbers x in 1 ... x make a list x,x-1, ... ,1, turn the numbers into a string and concatenate them into a single string. Again, concatenate those strings into a single string.
JavaScript, 53 bytes
f=(n,s='',x=n)=>{while(n)s+=n--;return x?f(--x)+s:''}
Thanks Titus for saving me bytes!
Perl 6, 22 bytes
{[~] flat [\R,] 1..$_}
A lambda that returns a string.
Explanation:
1..$_: Range of integers...(1 2 3 4)[,] 1..$_: Reduce ("fold") over comma operator...(1 2 3 4)[\,] 1..$_: With intermediate results (triangular reduce)...((1) (1 2) (1 2 3) (1 2 3 4))[\R,] 1..$_: Apply reversing meta-operator to the comma...((1) (2 1) (3 2 1) (4 3 2 1))[~] flat ...: Remove list nesting, and fold over string concat operator...1213214321
GolfScript, 14 bytes
~,{),{)}%-1%}%
Usual method of course, but this is GolfScript.
Explanation for this VAST piece of code:
~,{),{)}%-1%}% # Code
# Initial stack. ["n"]
~ # Eval ToS. [n]
, # ToS' lowered range. [[0..n)]
{),{)}%-1%} # Block. 1 argument. [a]
) # Increment. [a+1]
, # Range. [[0..a)]
{)} # Block. 1 argument. [b]
) # Increment. [b+1]
% # Map. [[1..a]]
-1 # Integer. -1 [[1..a] -1]
% # Each nth element. [[a..1]]
% # Map. [[[1],[2,1],...,[n..1]]]
# Implicit output. 121...n..1
Note that output is as a single number. Trailing \n.
C#, 72 69 65 bytes
n=>{for(int i=0,j;i<n;)for(j=++i;j>0;)System.Console.Write(j--);}
If the output can just be returned as opposed to being Written to the console
C#, 71 68 64 bytes
n=>{var s="";for(int i=0,j;i<n;)for(j=++i;j>0;)s+=j--;return s;}
Thanks to @VisualMelon for saving a lot of bytes
Test it here (Humourously the online compiler breaks at any number above 420)
Python 2, 71 68 bytes
I bet a recursive solution could be shorter, but I'm having a hard time formulating this into one.
n=input()
i=0
o=""
while i<n:
i+=1;j=i
while j:o+=`j`;j-=1
print o
Mathematica, 36 bytes
ToString/@(""<>Range[Range@#,1,-1])&
Throws a bunch of warnings which can be safely ignored.
Explanation
Using input 5 as an example:
Range@#
Creates a range {1, 2, 3, 4, 5}.
Range[...,1,-1]
Range is listable so we can give it a list for any of its arguments and it will automatically thread over that argument. So this gives us a bunch of reversed lists:
{{1}, {2, 1}, {3, 2, 1}, {4, 3, 2, 1}, {5, 4, 3, 2, 1}}
Next:
(""<>...)
This joins the nested list with the empty string. Since the nested list doesn't actually contain any strings, it can't really join the values (which is where the warnings are generated), but ""<> has the side-effect of flattening the list. So this gives us
1 <> 2 <> 1 <> 3 <> 2 <> 1 <> 4 <> 3 <> 2 <> 1 <> 5 <> 4 <> 3 <> 2 <> 1
Now comes Mathematica's beautiful feature that Map doesn't care about the structure it's mapping over. You normally apply it to a list, but it works with any head. f /@ h[a, b, c] simply gives you h[f[a], f[b], f[c]]. In our case, the head is StringJoin and the values are the integers.
ToString/@...
So this simply turns the integers into strings. At that point StringJoin[...] knows what to do with them and joins them all into a single string:
"121321432154321"
PowerShell, 41 bytes
1..$args[0]|%{$a+=-join($_..1)};,$a-ne101
(7 bytes to handle the special case of 0 for input)
Loops from 1 up to the input $args[0], each iteration concatenates onto $a the result of a -join operation operating on the range from the current number $_ down to 1. Then, we turn $a into an array , and select those elements of the array that are -notequal to 101 (this filters out the 0 input). That's left on the pipeline and output is implicit.
NB -- Since strings in PowerShell (and .NET) are based on the StringBuilder class which is a char array, the maximum length we can get to is 2^31-1. But, PowerShell on your desktop will likely run out of memory before then, and TIO has an output limit of 256 KiB, so the actual maximum value supported is quite a bit smaller than that.
APL, 10 bytes
∊⍕¨∘⌽∘⍳¨∘⍳
E.g.:
(∊⍕¨∘⌽∘⍳¨∘⍳)6
121321432154321654321
Explanation:
⍳: get the numbers from 1 to N.⍳¨∘: for each of those, get the numbers from 1 to N.⌽∘: reverse that list⍕¨∘: get the character representation of each item (so it does not output the numbers with spaces in between)∊: flatten the resulting array
C#, 67 65 bytes
f=n=>{int x=n;var r="";while(n>0)r+=n--;return x>0?f(x-1)+r:"";};
Anonymous recursive function which returns the required string.
Full program with ungolfed method and test cases:
using System;
public class Program
{
public static void Main()
{
Func<int, string> f = null;
f = n =>
{
int x = n;
var r = "";
while (n > 0)
r += n--;
return x > 0 ? f(x - 1) + r : "";
};
Console.WriteLine(f(6)); // 121321432154321654321
Console.WriteLine(f(1)); // 1
Console.WriteLine(f(26)); // 121321432154321654321765432187654321987654321109876543211110987654321121110987654321131211109876543211413121110987654321151413121110987654321161514131211109876543211716151413121110987654321181716151413121110987654321191817161514131211109876543212019181716151413121110987654321212019181716151413121110987654321222120191817161514131211109876543212322212019181716151413121110987654321242322212019181716151413121110987654321252423222120191817161514131211109876543212625242322212019181716151413121110987654321
Console.WriteLine(f(0)); // "" (empty string)
}
}
Pyth, 7 bytes
jks}R1S
A program that takes input of an integer and prints the result.
How it works
jks}R1S Program. Input: Q
jks}R1SQ Implicit input fill
R Map
SQ over [1, 2, 3, 4, ..., Q] with i:
} 1 Yield [i, i-1, i-2, i-3, ..., 1]
s Merge
jk Join
Implicitly print
Pyth, 8 bytes
jks_M._S
Explanation
jks_M._SQ Implicit input
SQ Get the range [1, 2, ..., N]
._ Get each prefix
_M Reverse each prefix
jks Join everything as a string
GameMaker Language, 65 bytes
b=""for(i=1;i<=argument0;i++){c=i while(j)b+=string(c--)}return b
05AB1E, 6 bytes
L€LíJJ
Explanation
Example input 4
L # range [1 ... input]
# STACK: [1,2,3,4]
€L # map: range
# STACK: [[1],[1,2],[1,2,3],[1,2,3,4]]
í # reverse each
# STACK: [[1],[2,1],[3,2,1],[4,3,2,1]]
J # join inner lists
# STACK: ['1','21','321','4321']
J # join list
# OUTPUT: 1213214321

