答:
PHP, 62 Bytes

```<code><?=preg_filter("# ([HQTW])#","\n$1",join(", ",range(A,Z)));?>.
</code>```

only for comparison 87 Bytes

```<code><?="A, B, C, D, E, F, G,\nH, I, J, K, L, M, N, O, P,\nQ, R, S,\nT, U, V,\nW, X, Y, Z.";
</code>```

Body:
PHP, 62 Bytes

<?=preg_filter("# ([HQTW])#","\n$1",join(", ",range(A,Z)));?>.

only for comparison 87 Bytes

<?="A, B, C, D, E, F, G,\nH, I, J, K, L, M, N, O, P,\nQ, R, S,\nT, U, V,\nW, X, Y, Z.";


问:
Obfuscated FizzBuzz Golf
Create the shortest possible obfuscated FizzBuzz implementation.

To be considered obfuscated, it should satisfy at least one of the following:

Does not contain any of the words "Fizz", "Buzz", or "FizzBuzz"

Does not contain the numbers 3, 5, or 15.

Use any of the above in a misleading way.

Remember: The goal is to be short and hard to follow.

The code sample which inspired this question follows:

```<code>public class Default
{
        enum FizzBuzz
        {
            Buzz = 1,
            Fizz,
            FizzBuzz
        }
        public static void Main(string[] args)
        {
            byte[] foo =
              Convert.FromBase64String("IAmGMEiCIQySYAiDJBjCIAmGMEiCIQySYA==");
            MemoryStream ms = new MemoryStream(foo);
            byte[] myByte = new byte[1];
            do
            {
                FizzBuzz fb;
                ms.Read(myByte, 0, 1);
                for (int i = 0; i < 4; i++)
                {
                    fb = (FizzBuzz)(myByte[0] >> (2 * i)
                         & (int)FizzBuzz.FizzBuzz);
                    Console.Out.WriteLine( (((int)fb > 0) ? "" + fb : ""
                         + ((ms.Position - 1) * 4 + i + 1)));
                }
            } while (ms.Position < ms.Length);
        }
}
</code>```

ContentLicense: CC BY-SA 2.5

Title: Obfuscated FizzBuzz Golf

Body:
JavaScript 111 chars - no key numbers

a=b=c=0;while(a++<99)document.write((b>1?(b=0,"Fizz"):(b++,""))+(c==4?(c=0,"Buzz"):(c++,""))+(b*c?a:"")+"<br>")


问:
Robot Finds Kitten

The challenge

The shortest code by character count to help Robot find kitten in the fewest steps possible.

Golfers, this is a time of crisis - Kitten gone missing and it's Robot's job to find it! Robot needs to reach Kitten in the shortest path possible. However, there are a lot of obstacles in Robot's way, and he needs you to program a solution for him.

Robot used to have a program do it for him, but that program was lost and Robot have no backup :(.

Robot's runtime is not the best, and the least characters Robot has to read from the source code, the least time it will spend processing, and that means Kitten will be found faster!

Robot's memory contains a map of the location he is currently in with the top representing North, bottom representing South, right representing East and left representing West. Robot is always in a rectangular room of an unknown size surrounded by walls, represented by # in his radar map. Areas Robot can walk in are represented by a space .

Robot's radar also scans for many obstacles in the room and marks them in various ASCII letters. Robot cannot walk across those obstacles. The radar will mark Kitten as the special ASCII character K, while Robot's location is marked with R.

Robot's navigation system works this way: He can understand a duo of direction and number of movement units he should travel to - for example, N 3 means 'go north 3 movement units'. Robot's radar map is made such that a movement unit is one ASCII character. Robot can only go in 4 directions and cannot travel diagonally.

Your task, brave Kitten saver, is to read Robot's radar map once, and output the least amount of directions, with the least movement unit travel distance. Robot is guaranteed to have at least one path to Kitten.

To ensure Robot does not waste time executing a malfunctioning program that will not help Robot find Kitten, I encourage you, brave Kitten saver, to use this output of Robot's past program to ensure no time is wasted on finding Kitten!

Test cases

```<code>Input:
    ######################
    #  d      3    Kj    #
    #                    #
    # R                  #
    #      q             #
    ######################
Output:
    E 13
    N 2
</code>```

```<code>Input:
    ######################
    #  d  r   3    Kj    #
    #    p        p      #
    #         T        X #
    #      q   s   t     #
    #                    #
    #  R o    d     W    #
    #                    #
    #    g      t     U  #
    #                    #
    ######################
Output:
    N 1
    E 10
    N 4
    E 2
</code>```

```<code>Input:
    ######################
    #  spdfmsdlwe9mw WEK3#
    #    we    hi        #
    #   rdf         fsszr#
    #     sdfg  gjkti    #
    #   fc  d g i        #
    #     dfg    sdd     #
    #    g        zfg    #
    #  df   df           #
    #             xcf   R#
    ######################
Output:
    N 1
    W 9
    N 5
    E 4
    N 1
    E 4
    N 1
</code>```

Code count includes input/output (i.e full program).

答:
Python 2.6 (535 characters)

```<code>exec 'eJzNlLFugzAQhneewhki2/KBworksVOkDu3QgVqVE2hBioFgCDhV371nJ1VbKR3SKYtl/jvs77MwtenafiBVqbs9WGcjLW05MB69tj05QEfqhpTNaMpeDyXDhsQORd3wLCK+YwT7u6PzFVK/Ep9Tsn6gmU50UTA2woHzc01KuqYZ20PPZSh85/iCO2etzBnTG8tcvlLxnovTPFVxzyGEC4lpiBay5xiuYMXBcRVtzxqTfP+IpqrelaRFsheoYJbBNvFj13asxd23gXHGmZU7bTaFDgiZH+MUYydtKBuZRuS0nvPmOt564Sl3CmlxcWAG6D3lXIkpeUMGB7nyfj82HW3FWvjTTVSYCXNJEUupEimannu+nl04WyM8XoB1F13E9S6Pt+ki0vDZXOdyd5su8X9cnm7DBa/tLGW4yh7yKCn1rIF+9vSTj/HiBeqCS1M3bMrnwOvbl5Ysi+eGLlkBhosjxl1fNwM5Ak7xH6CiT3SdT4U='.decode('base64').decode('zlib')
</code>```

Unpacks to a severely mistreated A* implementation. Reads stdin. Searches for solutions with minimal total distance. Breaks ties by preferring minimal number of directions. Lists moves to stdout. Finds kittens.

Unpacked:

The source has been manually anti-golfed in a few places in order to obtain a smaller compressed representation. For example, a for loop over the compass directions was unrolled.

```<code>import heapq,sys
a=set()
for v,p in enumerate(sys.stdin):
 for u,s in enumerate(p):
  if s in' KR':a.add((u,v))
  if s=='K':(q,r)=(u,v)
  if s=='R':y=(u,v)
o=[((abs(y[0]-q)+abs(y[1]-r),(y[0]!=q)+(y[1]!=r)),(0,0),y)]
c=set()
w={}
while o:
 _,h,x=heapq.heappop(o)
 c.add(x)
 s=lambda(u,v):(u,v-1)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'N'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 s=lambda(u,v):(u,v+1)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'S'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 s=lambda(u,v):(u+1,v)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'E'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 s=lambda(u,v):(u-1,v)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'W'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 if x==(q,r):
  z=''
  while x in w:
   _,x,(m,d)=min(w[x])
   z='%s %d\n'%(d,m)+z
  print z,
  o=[]
</code>```

OwnerDisplayName: LiraNuna

Title: Robot Finds Kitten

Body:
Python 2.6 (535 characters)

exec 'eJzNlLFugzAQhneewhki2/KBworksVOkDu3QgVqVE2hBioFgCDhV371nJ1VbKR3SKYtl/jvs77MwtenafiBVqbs9WGcjLW05MB69tj05QEfqhpTNaMpeDyXDhsQORd3wLCK+YwT7u6PzFVK/Ep9Tsn6gmU50UTA2woHzc01KuqYZ20PPZSh85/iCO2etzBnTG8tcvlLxnovTPFVxzyGEC4lpiBay5xiuYMXBcRVtzxqTfP+IpqrelaRFsheoYJbBNvFj13asxd23gXHGmZU7bTaFDgiZH+MUYydtKBuZRuS0nvPmOt564Sl3CmlxcWAG6D3lXIkpeUMGB7nyfj82HW3FWvjTTVSYCXNJEUupEimannu+nl04WyM8XoB1F13E9S6Pt+ki0vDZXOdyd5su8X9cnm7DBa/tLGW4yh7yKCn1rIF+9vSTj/HiBeqCS1M3bMrnwOvbl5Ysi+eGLlkBhosjxl1fNwM5Ak7xH6CiT3SdT4U='.decode('base64').decode('zlib')

Unpacks to a severely mistreated A* implementation. Reads stdin. Searches for solutions with minimal total distance. Breaks ties by preferring minimal number of directions. Lists moves to stdout. Finds kittens.

Unpacked:

The source has been manually anti-golfed in a few places in order to obtain a smaller compressed representation. For example, a for loop over the compass directions was unrolled.

import heapq,sys
a=set()
for v,p in enumerate(sys.stdin):
 for u,s in enumerate(p):
  if s in' KR':a.add((u,v))
  if s=='K':(q,r)=(u,v)
  if s=='R':y=(u,v)
o=[((abs(y[0]-q)+abs(y[1]-r),(y[0]!=q)+(y[1]!=r)),(0,0),y)]
c=set()
w={}
while o:
 _,h,x=heapq.heappop(o)
 c.add(x)
 s=lambda(u,v):(u,v-1)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'N'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 s=lambda(u,v):(u,v+1)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'S'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 s=lambda(u,v):(u+1,v)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'E'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 s=lambda(u,v):(u-1,v)
 y=s(x)
 m=1
 while y in a-c:
  w[y]=[(h,x,(m,'W'))]+w.get(y,[])
  heapq.heappush(o,((abs(y[0]-q)+abs(y[1]-r)+h[0]+m,(y[0]!=q)+(y[1]!=r)+h[1]+1),(h[0]+m,h[1]+1),y))
  m+=1
  y=s(y)
 if x==(q,r):
  z=''
  while x in w:
   _,x,(m,d)=min(w[x])
   z='%s %d\n'%(d,m)+z
  print z,
  o=[]


问:
Translate number pairs to guitar notes
A guitar fretboard diagram looks like this:

```<code>  0  1  2  3  4  5  6  7  8  9 10 11 12   <- Fret number (0 means it's open)
|-E--F--F#-G--G#-A--A#-B--C--C#-D--D#-E
|-B--C--C#-D--D#-E--F--F#-G--G#-A--A#-B
|-G--G#-A--A#-B--C--C#-D--D#-E--F--F#-G
|-D--D#-E--F--F#-G--G#-A--A#-B--C--C#-D
|-A--A#-B--C--C#-D--D#-E--F--F#-G--G#-A
|-E--F--F#-G--G#-A--A#-B--C--C#-D--D#-E
</code>```

As you can see, the first string (from the top) open is an E. The first fret on the first string is an F. The fourth fret on the third string is a B. Note that the first note is the zeroth fret, not the first.

This can be written with numbers on the format string, fret. The strings are numbered from 1 to 6 from top to bottom.
The frets are numbered from 0 to 12 from left to right. The first E is therefore 1, 0. Some other examples:

```<code>1, 0 --> E
1, 1 --> F
3, 5 --> C
5, 1 --> A#
6, 6 --> A#
</code>```

Challenge:

Take N pairs of numbers (s and f), and output a delimited note succession.

The input may be on any suitable format. tuples, 2D-matrix, two separate lists, an interweaved list (string,fret,string,fret...) etc.

The output tone should be separated, but the delimiter is optional (comma, space, dash...). The output can be in either upper or lower case.

s (for string) will be in the range [1, 6] (you may choose to have i 0-indexed)

f (for fret) will be in the range [0, 12]

Test cases and examples:

```<code>1 4 5 2 1 3   <- String
4 2 6 3 5 1   <- Fret
G# E D# D A G#

6 2 3 1 4 2 3 2 2 2 6 5 2
0 1 2 3 4 5 6 7 8 9 10 11 12
E C A G F# E C# F# G G# D G# B

3 3 3 3 3 3 3 3 3 3 3 3 3   <- String
0 3 5 0 3 6 5 0 3 5 3 0 0   <- Fret
G A# C G A# C# C G A# C A# G G

// The same test case, but different input and output format:
(3,0)(3,3)(3,5)(3,3)(3,6)(3,5)(3,0)(3,3)(3,5)(3,3)(3,0)(3,0)
G,A#,C,G,A#,C#,C,G,A#,C,A#,G,G
</code>```

Good luck, and happy golfing!

答:
C#, 131 bytes

```<code>string n(int[]s,int[]f){return string.Join(" ",s.Zip(f,(x,y)=>"E,F,F#,G,G#,A,A#,B,C,C#,D,D#".Split(',')[(7*x-7+y+(x<3?0:1))%12]));}
</code>```

Input two separate lists, strings are 1 based.

ContentLicense: CC BY-SA 3.0

Title: Translate number pairs to guitar notes

Body:
C#, 131 bytes

string n(int[]s,int[]f){return string.Join(" ",s.Zip(f,(x,y)=>"E,F,F#,G,G#,A,A#,B,C,C#,D,D#".Split(',')[(7*x-7+y+(x<3?0:1))%12]));}

Input two separate lists, strings are 1 based.


问:
Least Common Multiple
The least common multiple of a set of positive integers A is the smallest postive integer B such that, for each k in A, there exists a positive integer n such that k*n = B.

Given at least two positive integers as input, output their least common multiple.

Rules

Builtins are allowed, but if your solution uses one, you are encouraged to include an alternate solution that does not use GCD/LCM builtins. However, the alternate solution will not count towards your score at all, so it is entirely optional.

All inputs and outputs will be within the natively-representable range for your language. If your language is natively capable of arbitrarily-large integers, then your solution must work with arbitrarily large inputs and outputs.

Test cases

```<code>[7, 2] -> 14
[8, 1] -> 8
[6, 4, 8] -> 24
[8, 2, 1, 10] -> 40
[9, 6, 2, 1, 5] -> 90
[5, 5, 7, 1, 1] -> 35
[4, 13, 8, 8, 11, 1] -> 1144
[7, 2, 2, 11, 11, 8, 5] -> 3080
[1, 6, 10, 3, 4, 10, 7] -> 420
[5, 2, 9, 10, 3, 4, 4, 4, 7] -> 1260
[9, 7, 10, 9, 7, 8, 5, 10, 1] -> 2520
</code>```

答:
05AB1E/2sable, 2 bytes

```<code>.¿
</code>```

Try it online! in 05AB1E

or 2sable

Title: Least Common Multiple

Body:
05AB1E/2sable, 2 bytes

.¿

Try it online! in 05AB1E

or 2sable


答:
Jelly, 3 bytes

```<code>æl/
</code>```

Reduces by LCM. Try it online! or verify all test cases.

Alternate version, 6 bytes

```<code>ÆE»/ÆẸ
</code>```

Try it online! or verify all test cases.

How it works

```<code>ÆE»/ÆẸ  Main link. Argument: A (array)

ÆE      Yield all prime exponents of each integer in A.
  »/    Reduce columns (exponents that correspond to the same prime) by maximum.
    ÆẸ  Turn the resulting array of prime exponents into the corresponding integer.
</code>```

Title: Least Common Multiple

Body:
The least common multiple of a set of positive integers A is the smallest postive integer B such that, for each k in A, there exists a positive integer n such that k*n = B.

Given at least two positive integers as input, output their least common multiple.

Rules

Builtins are allowed, but if your solution uses one, you are encouraged to include an alternate solution that does not use GCD/LCM builtins. However, the alternate solution will not count towards your score at all, so it is entirely optional.

All inputs and outputs will be within the natively-representable range for your language. If your language is natively capable of arbitrarily-large integers, then your solution must work with arbitrarily large inputs and outputs.

Test cases

```<code>[7, 2] -> 14
[8, 1] -> 8
[6, 4, 8] -> 24
[8, 2, 1, 10] -> 40
[9, 6, 2, 1, 5] -> 90
[5, 5, 7, 1, 1] -> 35
[4, 13, 8, 8, 11, 1] -> 1144
[7, 2, 2, 11, 11, 8, 5] -> 3080
[1, 6, 10, 3, 4, 10, 7] -> 420
[5, 2, 9, 10, 3, 4, 4, 4, 7] -> 1260
[9, 7, 10, 9, 7, 8, 5, 10, 1] -> 2520
</code>```

Body:
Jelly, 3 bytes

æl/

Reduces by LCM. Try it online! or verify all test cases.

Alternate version, 6 bytes

ÆE»/ÆẸ

Try it online! or verify all test cases.

How it works

ÆE»/ÆẸ  Main link. Argument: A (array)

ÆE      Yield all prime exponents of each integer in A.
  »/    Reduce columns (exponents that correspond to the same prime) by maximum.
    ÆẸ  Turn the resulting array of prime exponents into the corresponding integer.


问:
Now I know my ABCs, won't you come and golf with me?
Write a program or function that outputs this exact text, case-insensitive:

```<code>A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

This is code-golf, so the shortest code in bytes wins.

Body:
Python 2.7, <s>67 66</s> 63 bytes

a=65;exec"print'%c'%a+',.'[a>89]+'\\n'[a%42%39%9^2:],;a+=1;"*26

Dennis saved a byte.


答:
MATL, 3 bytes

```<code>&Zm
</code>```

This uses the builtin function with array input.

Try it online!

Title: Least Common Multiple

Body:
MATL, 3 bytes

&Zm

This uses the builtin function with array input.

Try it online!


答:
Python, <s>69</s> <s>65</s> <s>52</s> 50 bytes

```<code>A=lambda l,i=1:any(i%a for a in l)and A(l,i+1)or i
</code>```

2 bytes saved thanks to Dennis!

Pretty straightforward recursive solution, you will need to make the recursion limit a bit higher for some of the test cases to work.

Title: Least Common Multiple

Body:
Python, <s>69</s> <s>65</s> <s>52</s> 50 bytes

A=lambda l,i=1:any(i%a for a in l)and A(l,i+1)or i

2 bytes saved thanks to Dennis!

Pretty straightforward recursive solution, you will need to make the recursion limit a bit higher for some of the test cases to work.


答:
JavaScript (ES6), <s>80</s> 74 bytes

```<code>_=>[...`ABCDEFGHIJKLMNOPQRSTUVWXYZ`].join`, `.replace(/[HQTW]/g,`
$&`)+`.`
</code>```

Probably possible to shorten this with atob/btoa if you can work out how to use ISO-8859-1 encoding. Edit: Saved 6 bytes thanks to @RickHitchcock.

Title: Now I know my ABCs, won't you come and golf with me?

Body:
Write a program or function that outputs this exact text, case-insensitive:

```<code>A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

This is code-golf, so the shortest code in bytes wins.

Body:
JavaScript (ES6), <s>80</s> 74 bytes

_=>[...`ABCDEFGHIJKLMNOPQRSTUVWXYZ`].join`, `.replace(/[HQTW]/g,`
$&`)+`.`

Probably possible to shorten this with atob/btoa if you can work out how to use ISO-8859-1 encoding. Edit: Saved 6 bytes thanks to @RickHitchcock.


问:
Dennis numbers 2.0
PPCG user and elected mod, @Dennis just became the second ever user to earn over 100k rep!

This is a totally original idea, that I did not get from anybody else, but let's make a challenge based off of his user ID, 12012 as a tribute!

Looking at it, you'll notice that there are two distinct "sections" to his ID.

12

and

012

Both of these sections add up to a 3. That's a pretty interesting property.

Let's define a "Dennis 2.0 number" as any positive integer where every maximal subsequence of strictly increasing digits sums to the same number. For example,

```<code>123
</code>```

is a Dennis 2.0 number because there is only one maximal sublist of strictly increasing digits, and it sums to 6. Additionally, 2,846,145 is also a Dennis 2.0 number because the three maximal sublists of increasing digits, namely

```<code>28
46
145
</code>```

All sum to 10. Additionally, numbers that just repeat the same digit must be Dennis 2.0 numbers because, for example, 777 can be broken down into

```<code>7
7
7
</code>```

which clearly all sum to seven.

A number such as 42 is not a Dennis 2.0 number, since it is broken down into

```<code>4
2
</code>```

which clearly do not sum to the same number.

The challenge

You must write a program or function to determine if a given number is a Dennis 2.0 number or not. You can take input and output in any reasonable input format, e.g. as a string, as a number, from a file, funtion arguments/return, from STDIN/STDOUT, etc. and then return a truthy value if this number is a Dennis 2.0 number, and a falsy value if it is not. For reference, here is every Dennis 2.0 number up to 1,000:

```<code>1
2
3
4
5
6
7
8
9
11
12
13
14
15
16
17
18
19
22
23
24
25
26
27
28
29
33
34
35
36
37
38
39
44
45
46
47
48
49
55
56
57
58
59
66
67
68
69
77
78
79
88
89
99
101
111
123
124
125
126
127
128
129
134
135
136
137
138
139
145
146
147
148
149
156
157
158
159
167
168
169
178
179
189
202
222
234
235
236
237
238
239
245
246
247
248
249
256
257
258
259
267
268
269
278
279
289
303
312
333
345
346
347
348
349
356
357
358
359
367
368
369
378
379
389
404
413
444
456
457
458
459
467
468
469
478
479
489
505
514
523
555
567
568
569
578
579
589
606
615
624
666
678
679
689
707
716
725
734
777
789
808
817
826
835
888
909
918
927
936
945
999
</code>```

Standard loopholes apply, and the shortest answer measured in bytes wins!

答:
Perl, 38 + 3 (-p) = 41 bytes

-9 bytes thanks to @Ton Hospel !

s%.%2x$&.(~$&le~$')%eg;$_=/^(2+1)\1*$/
```

<p>Since there is a <code>$'</code>, the code needs to be in a file to run. So <code>-p</code> counts for 3 bytes. Outputs 1 if the number is a Dennis 2.0 number, or an empty string otherwise :</p>

```$ cat dennis_numbers.pl
s%.%2x$&.(~$&le~$')%eg;$_=/^(2+1)\1*$/
$ perl -p dennis_numbers.pl <<< "1
10
12315
12314"
```

Title: Dennis numbers 2.0

Body:
Perl, 38 + 3 (-p) = 41 bytes

-9 bytes thanks to @Ton Hospel !

s%.%2x$&.(~$&le~$')%eg;$_=/^(2+1)\1*$/

Since there is a $', the code needs to be in a file to run. So -p counts for 3 bytes. Outputs 1 if the number is a Dennis 2.0 number, or an empty string otherwise :

$ cat dennis_numbers.pl
s%.%2x$&.(~$&le~$')%eg;$_=/^(2+1)\1*$/
$ perl -p dennis_numbers.pl <<< "1
10
12315
12314"


答:
MATL, 7 bytes

```<code>&YFX>^p
</code>```

No builtin.

Try it online!

Explanation

Let's take input [8, 2, 1, 10] as an example.

```<code>&YF    % Take array implicitly. Push vector of prime factors and matrix of exponents
       % of factorization, where each row represents one of the input numbers
       %   STACK: [2 3 5], [3 0 0; 1 0 0; 0 0 0; 1 0 1]
X>     % Maximum of each column
       %   STACK: [2 3 5], [3 0 1]
^      % Element-wise power
       %   STACK: [8 1 5]
p      % Product of array
       %   STACK: 40
       % Implicitly display
</code>```

EDIT (June 9, 2017): YF with two outputs has been modified in release 20.1.0: non-factor primes and their (zero) exponents are skipped. This doesn't affect the above code, which works without requiring any changes.

Title: Least Common Multiple

Body:
MATL, 7 bytes

&YFX>^p

No builtin.

Try it online!

Explanation

Let's take input [8, 2, 1, 10] as an example.

&YF    % Take array implicitly. Push vector of prime factors and matrix of exponents
       % of factorization, where each row represents one of the input numbers
       %   STACK: [2 3 5], [3 0 0; 1 0 0; 0 0 0; 1 0 1]
X>     % Maximum of each column
       %   STACK: [2 3 5], [3 0 1]
^      % Element-wise power
       %   STACK: [8 1 5]
p      % Product of array
       %   STACK: 40
       % Implicitly display

EDIT (June 9, 2017): YF with two outputs has been modified in release 20.1.0: non-factor primes and their (zero) exponents are skipped. This doesn't affect the above code, which works without requiring any changes.


Title: Least Common Multiple

Body:
PowerShell v2+, <s>73</s> 60 bytes

param($a)for($i=1;($a|?{!($i%$_)}).count-ne$a.count){$i++}$i

Takes input $a, loops upward from $i=1 with $i++, based on a conditional. The condition is ($a|?{!($i%$_)}).count being -notequal to $a.count. Meaning, the loop ends when the elements of $a that are divisors of $i is equal to the elements of $a. Then, a solitary $i is left on the pipeline, and output is implicit.

Test Cases

PS C:\Tools\Scripts\golfing> @(7,2),@(8,1),@(6,4,8),@(8,2,1,10),@(9,6,2,1,5),@(5,5,7,1,1),@(4,13,8,8,11,1)|%{($_-join',')+" -> "+(.\least-common-multiple.ps1 $_)}
7,2 -> 14
8,1 -> 8
6,4,8 -> 24
8,2,1,10 -> 40
9,6,2,1,5 -> 90
5,5,7,1,1 -> 35
4,13,8,8,11,1 -> 1144

PS C:\Tools\Scripts\golfing> @(7,2,2,11,11,8,5),@(1,6,10,3,4,10,7),@(5,2,9,10,3,4,4,4,7),@(9,7,10,9,7,8,5,10,1)|%{($_-join',')+" -> "+(.\least-common-multiple.ps1 $_)}
7,2,2,11,11,8,5 -> 3080
1,6,10,3,4,10,7 -> 420
5,2,9,10,3,4,4,4,7 -> 1260
9,7,10,9,7,8,5,10,1 -> 2520


答:
JavaScript (ES6), <s>63</s> 59 bytes

```<code>f=([x,...a])=>a[0]?x*f(a)/(g=(m,n)=>n?g(n,m%n):m)(x,f(a)):x
</code>```

Recursively finds the LCM of the last two elements.

Title: Least Common Multiple

Body:
JavaScript (ES6), <s>63</s> 59 bytes

f=([x,...a])=>a[0]?x*f(a)/(g=(m,n)=>n?g(n,m%n):m)(x,f(a)):x

Recursively finds the LCM of the last two elements.


答:
Julia (3 Bytes) [Working on Non-Built-in]

```<code>lcm     # Using LCM built-in (3 Bytes)
</code>```

As Dennis pointed out, I keep forgetting that Julia automatically vectorizes inputs.

Example:

```<code>println(lcm(1,2,3,4,5,6,7,8,9)) #Prints 2520
</code>```

Title: Least Common Multiple

Body:
Julia (3 Bytes) [Working on Non-Built-in]

lcm     # Using LCM built-in (3 Bytes)

As Dennis pointed out, I keep forgetting that Julia automatically vectorizes inputs.

Example:

println(lcm(1,2,3,4,5,6,7,8,9)) #Prints 2520


答:
Dyalog APL, 2 bytes

```<code>∧/
</code>```

Reduces by LCM. Test it on TryAPL.

Title: Least Common Multiple

Body:
Dyalog APL, 2 bytes

∧/

Reduces by LCM. Test it on TryAPL.


答:
JavaScript (ES6), 36 bytes

f=(a,i=1)=>a.some(v=>i%v)?f(a,i+1):i
```
<p>Starting from <code>1</code> it's the first number that can be divided by all.</p>
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>f=(a,i=1)=>a.some(v=>i%v)?f(a,i+1):i
;

console.log(f([7, 2]));
console.log(f([8, 1]));
console.log(f([6, 4, 8]));
console.log(f([8, 2, 1, 10]));
console.log(f([9, 6, 2, 1, 5]));
console.log(f([5, 5, 7, 1, 1]));
console.log(f([4, 13, 8, 8, 11, 1]));
console.log(f([7, 2, 2, 11, 11, 8, 5]));
console.log(f([1, 6, 10, 3, 4, 10, 7]));
console.log(f([5, 2, 9, 10, 3, 4, 4, 4, 7]));
console.log(f([9, 7, 10, 9, 7, 8, 5, 10, 1]));</code>```

Title: Least Common Multiple

Body:
JavaScript (ES6), 36 bytes

f=(a,i=1)=>a.some(v=>i%v)?f(a,i+1):i

Starting from 1 it's the first number that can be divided by all.

f=(a,i=1)=>a.some(v=>i%v)?f(a,i+1):i
;

console.log(f([7, 2]));
console.log(f([8, 1]));
console.log(f([6, 4, 8]));
console.log(f([8, 2, 1, 10]));
console.log(f([9, 6, 2, 1, 5]));
console.log(f([5, 5, 7, 1, 1]));
console.log(f([4, 13, 8, 8, 11, 1]));
console.log(f([7, 2, 2, 11, 11, 8, 5]));
console.log(f([1, 6, 10, 3, 4, 10, 7]));
console.log(f([5, 2, 9, 10, 3, 4, 4, 4, 7]));
console.log(f([9, 7, 10, 9, 7, 8, 5, 10, 1]));


Body:
C, 112 102 81 bytes

Thanks to cleblanc & LevelRiverSt!

i,c;main(){for(c=64;++c<91;)printf("%c%c%c",c,44+c/90*2,c=="GPSVZ"[i]?++i,10:32);}


答:
Cheddar, 33 bytes

```<code>(n,i=1)f->n.any(i&(%))?f(n,i+1):i
</code>```

Nothing super new.

Ungolfed

```<code>(n, i = 1) f ->
  n.any(j -> i % j) ?
    f(n, i + 1) :
    i
</code>```

Basically this starts at one and keeps increasing until it finds an LCM

Title: Least Common Multiple

Body:
Cheddar, 33 bytes

(n,i=1)f->n.any(i&(%))?f(n,i+1):i

Nothing super new.

Ungolfed

(n, i = 1) f ->
  n.any(j -> i % j) ?
    f(n, i + 1) :
    i

Basically this starts at one and keeps increasing until it finds an LCM


答:
Pyth - <s>7</s> 6 bytes

No builtin.

```<code>*F{sPM
</code>```

Try it online here.

Title: Least Common Multiple

Body:
Pyth - <s>7</s> 6 bytes

No builtin.

*F{sPM

Try it online here.


答:
PHP, <s>67</s> <s>65</s> 64 bytes

Not exactly short, but it works.

This assumes that all errors are going to stderr.

```<code>foreach(range(A,Z)as$C)echo$C,",."[$C>Y],"
 "[!strstr(GPSV,$C)];
</code>```

You can try it on http://ideone.com/VSK8Yu.

Thanks to @Jörg Hülsermann for saving 2 bytes!
And thanks to @Titus for saving me 1 byte!

Body:
PHP, <s>67</s> <s>65</s> 64 bytes

Not exactly short, but it works.

This assumes that all errors are going to stderr.

foreach(range(A,Z)as$C)echo$C,",."[$C>Y],"
 "[!strstr(GPSV,$C)];

You can try it on http://ideone.com/VSK8Yu.

Thanks to @Jörg Hülsermann for saving 2 bytes!
And thanks to @Titus for saving me 1 byte!


答:
Perl, 37 bytes

Credits to @Dom Hastings for this solution (3 bytes shorter than mine, see bellow).

say+(map"$_, ".$/x/[GPSV]/,A..Y),"Z."
```

<p>Run with <code>-E</code> (or <code>-M5.010</code>) flag :</p>

```perl -E 'say+(map"$_, ".$/x/[GPSV]/,A..Y),"Z."'
```

<p>My previous version, 3 bytes longer (total of 40 bytes) : </p>

```perl -E '$_=join", ",A..Z;s/[HQTW]/\n$&/g;say"$_."'
```

Body:
Perl, 37 bytes

Credits to @Dom Hastings for this solution (3 bytes shorter than mine, see bellow).

say+(map"$_, ".$/x/[GPSV]/,A..Y),"Z."

Run with -E (or -M5.010) flag :

perl -E 'say+(map"$_, ".$/x/[GPSV]/,A..Y),"Z."'

My previous version, 3 bytes longer (total of 40 bytes) :

perl -E '$_=join", ",A..Z;s/[HQTW]/\n$&/g;say"$_."'


答:
Japt, 24 bytes

```<code>;B¬qJ+S r"[HQTW]"@R+XÃ+L
</code>```

Test it online!

How it works

```<code>;                        // Reset various variables. B is set to "ABC...XYZ", J is set to ",", and L is set to ".".
 B¬                      // Take the uppercase alphabet and split into chars.
   qJ+S                  // Join with ", ".
        r"[HQTW]"        // Replace each H, Q, T, or W with
                 @R+XÃ   //   a newline plus the character.
                      +L // Append a period to the result.
                         // Implicit: output last expression
</code>```

Body:
Japt, 24 bytes

;B¬qJ+S r"[HQTW]"@R+XÃ+L

Test it online!

How it works

;                        // Reset various variables. B is set to "ABC...XYZ", J is set to ",", and L is set to ".".
 B¬                      // Take the uppercase alphabet and split into chars.
   qJ+S                  // Join with ", ".
        r"[HQTW]"        // Replace each H, Q, T, or W with
                 @R+XÃ   //   a newline plus the character.
                      +L // Append a period to the result.
                         // Implicit: output last expression


Body:
Pyke, <s>23</s> <s>19</s> 17 bytes

G\,J\.+2cu  /P

Try it here!

G\,J\.+        -    ",".join(alphabet)+"."
       2c      -   split(^, size=2)
            /  -  split_sized(^, V)
         u     -   yield list [7,9,3,3] (actual bytes `u%04%07%09%03%03`)
             P - print(^)


答:
R, 146 bytes

L=LETTERS
f=function(x,y=""){paste(x,collapse=paste0(", ",y))}
cat(f(c(f(L[1:7]),f(L[8:16]),f(L[17:19]),f(L[20:22]),f(L[23:26])),"\n"),".",sep="")
```

Explanation:

LETTERS is predefined for uppercase letters.

The f function is for concatenating vector x on , with additional y (used for newlines).

The cat is the used as it prints \n as newlines. f is called on the letters to form rows and then on the rows again to form the whole output.

Probably golfable - I don't like the multiple calls of f...

Body:
R, 146 bytes

L=LETTERS
f=function(x,y=""){paste(x,collapse=paste0(", ",y))}
cat(f(c(f(L[1:7]),f(L[8:16]),f(L[17:19]),f(L[20:22]),f(L[23:26])),"\n"),".",sep="")

Explanation:

LETTERS is predefined for uppercase letters.

The f function is for concatenating vector x on , with additional y (used for newlines).

The cat is the used as it prints \n as newlines. f is called on the letters to form rows and then on the rows again to form the whole output.

Probably golfable - I don't like the multiple calls of f...


问:
The Möbius Function
The Möbius function is an important number theoretic function.

Your submission should accept a positive integer \$n\$ and return the value of the Möbius function evaluated at \$n\$.

Definition

The Möbius function \$μ(n)\$ is defined as follows:

$$\mu(n) = \begin{cases}
\hphantom{-}1, &n\text{ is squarefree and has an even number of distinct prime factors} \\
-1, &n\text{ squarefree and has an odd number of distinct prime factors} \\
\hphantom{-}0, &\text{otherwise}
\end{cases}$$

\$n\$ is called squarefree if the exponents of the prime factorization of \$n\$ are all strictly less that two. (Alternatively: No prime to the power of two divides \$n\$).

Test cases

Here you can see the first 50 values of μ:

Public Domain Image from Wikipedia

The Möbius function is sequence number A008683 in the OEIS.

These are the first 77 values:

```<code>1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0, 1, -1, -1, 0, 1, -1, -1, 0, -1, 1, 0, 0, 1
</code>```

Larger values can also easily be checked in Wolframalpha.com or in the b-file of OEIS, as suggested by @MartinBüttner.

答:
Seriously, 11 bytes

Golfing suggestions welcome. Try it online!

```<code>;y;l0~ⁿ)π=*
</code>```

Ungolfing

```<code>     Implicit input n.
;    Duplicate n.
y    Push a list of the distinct prime factors of n. Call it dpf.
;    Duplicate dpf.
l    Push len(dpf).
0~   Push -1.
ⁿ    Push (-1)**len(dpf).
)    Rotate (-1)**len(dpf) to BOS. Stack: dpf, n, (-1)**len(dpf)
π    Push product(dpf).
=    Check if product(dpf) == n.
      This is only true if n is squarefree.
*    Multiply (n is squarefree) by (-1)**len(dpf).
     Implicit return.
</code>```

ContentLicense: CC BY-SA 4.0

Title: The Möbius Function

Body:
Seriously, 11 bytes

Golfing suggestions welcome. Try it online!

;y;l0~ⁿ)π=*

Ungolfing

     Implicit input n.
;    Duplicate n.
y    Push a list of the distinct prime factors of n. Call it dpf.
;    Duplicate dpf.
l    Push len(dpf).
0~   Push -1.
ⁿ    Push (-1)**len(dpf).
)    Rotate (-1)**len(dpf) to BOS. Stack: dpf, n, (-1)**len(dpf)
π    Push product(dpf).
=    Check if product(dpf) == n.
      This is only true if n is squarefree.
*    Multiply (n is squarefree) by (-1)**len(dpf).
     Implicit return.


答:
JavaScript (ES6), <s>66</s> 65 bytes

Beating @Neil was impossible... That's why I did it. :-)

```<code>f=(i=10)=>i>34?"z.":i.toString(++i)+","+`
`[9568512>>i-9&1]+f(i)
</code>```

Golfed 1 byte thanks to a trick from @LevelRiverSt. Using String.fromCharCode is 7 bytes longer:

```<code>f=(i=65)=>i>89?"Z.":String.fromCharCode(i,44,i%86%83%80%71?32:10)+f(i+1)
</code>```

How it works

This recursively generates each character of the alphabet from a to y, using .toString(). A comma is appended after each letter, plus a newline if 9568512>>i-9&1 is 1, or a space otherwise. When the recursion gets past 34, i.e. to z, the function simply returns "z.".

Body:
Write a program or function that outputs this exact text, case-insensitive:

```<code>A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

This is code-golf, so the shortest code in bytes wins.

Body:
JavaScript (ES6), <s>66</s> 65 bytes

Beating @Neil was impossible... That's why I did it. :-)

f=(i=10)=>i>34?"z.":i.toString(++i)+","+`
`[9568512>>i-9&1]+f(i)

Golfed 1 byte thanks to a trick from @LevelRiverSt. Using String.fromCharCode is 7 bytes longer:

f=(i=65)=>i>89?"Z.":String.fromCharCode(i,44,i%86%83%80%71?32:10)+f(i+1)

How it works

This recursively generates each character of the alphabet from a to y, using .toString(). A comma is appended after each letter, plus a newline if 9568512>>i-9&1 is 1, or a space otherwise. When the recursion gets past 34, i.e. to z, the function simply returns "z.".


问:
Interpret loose ranges

Interpret loose ranges

ListSharp is an interpreted programming language that has many features, one of those features is a 1 index based range creator that works like this:

You define a range as (INT) TO (INT) or just (INT) where both or the single int can go from min to max int32 value

Then you can use those ranges to extract elements of an array without fearing to overstep it's boundaries

therefore:

1 TO 5 generates: {1,2,3,4,5}

3 generates: {3}

Ranges can be added up using the AND operator

1 TO 5 AND 3 TO 6 generates: {1,2,3,4,5,3,4,5,6}

remember this works with negative numbers as well

3 TO -3 generates: {3,2,1,0,-1,-2,-3}

The challenge is the following:

Input

A character array and the previously defined range clause as a string

Output

The elements at the 1 index based locations of the range (non existing/negative indexes translate to an empty character)

How to win

As a code-golf challenge you are supposed to create the program with the shortest byte count to win

It has been pointed out empty characters do not exist, therefore you should be ignoring them (I only showed them here to make it easier to understand yet it confused people)

Test cases:

```<code>input array is:
{'H','e','l','l','o',' ','W','o','r','l','d'}

range clause:
"1 TO 3" => "Hel"
"5" => "o"
"-10 TO 10" => "Hello Worl"
"0 AND 2 AND 4" => "el"
"8 TO 3" => "oW oll"
"-300 AND 300" => ""
"1 TO 3 AND 3 TO 1" => "HelleH"
"-20 TO 0 AND 1 AND 4" => "Hl"
</code>```

答:
Groovy (<s>99</s> 97 Bytes)

```<code>{n,v->Eval.me("[${n.replaceAll(" TO ","..").replaceAll(" AND ",",")}]").flatten().collect{v[it]}}
</code>```

Try it here: https://groovyconsole.appspot.com/edit/5155820207603712

Explanation:

.replaceAll(" TO ","..") - Replace the to with a traditional range.

.replaceAll(" AND ", ",") - Replace all ands with a comma.

"[${...}]" - Surround it with the "list" notation in Groovy.

Eval.me(...) - Evaluate string as Groovy code.

.flatten() - Flatten the mixture of 2D array and 1D array into a 1D array.

.collect{v[it]} - Collect the indices from the array into a single structure.

Here's a <s>115</s> 113 byte solution removing nulls from the output:
https://groovyconsole.appspot.com/edit/5185924841340928

Here's a 117 byte solution if you say it MUST be indexed at 1 instead of 0:
https://groovyconsole.appspot.com/edit/5205468955803648

If you want me to swap out the original for the 113/117 byte one, let me know.

Title: Interpret loose ranges

Body:
Groovy (<s>99</s> 97 Bytes)

{n,v->Eval.me("[${n.replaceAll(" TO ","..").replaceAll(" AND ",",")}]").flatten().collect{v[it]}}

Try it here: https://groovyconsole.appspot.com/edit/5155820207603712

Explanation:

.replaceAll(" TO ","..") - Replace the to with a traditional range.

.replaceAll(" AND ", ",") - Replace all ands with a comma.

"[${...}]" - Surround it with the "list" notation in Groovy.

Eval.me(...) - Evaluate string as Groovy code.

.flatten() - Flatten the mixture of 2D array and 1D array into a 1D array.

.collect{v[it]} - Collect the indices from the array into a single structure.

Here's a <s>115</s> 113 byte solution removing nulls from the output:
https://groovyconsole.appspot.com/edit/5185924841340928

Here's a 117 byte solution if you say it MUST be indexed at 1 instead of 0:
https://groovyconsole.appspot.com/edit/5205468955803648

If you want me to swap out the original for the 113/117 byte one, let me know.


答:
Java 8, <s>75</s> <s>59</s> <s>121</s> 89 bytes

Uses the Euclidean Algorithm and the fact that
LCM(A, B)= A * B / GCD(A, B)

16 bytes off. Thanks to @carusocomputing

Added Multi-Input +62 bytes

32 bytes off. Thanks to @Olivier Grégoire

Code:

```<code>public static int lcm(int l, int c){
  for(int i=1;i<=l&&i<=c;++i)
    if (i%l==0&&i%c==0)
      return l*c/i;
}
public static int lcm(int...x){
  int y=x[0];
  for(int j:x){
    y=lcm(j,y);
  }
  return y;
}
</code>```

Remove line-breaks:

```<code>int g(int a,int b){return b<1?a:g(b,a%b);}
</code>```

```<code>l->{int l=1;for(int n:a)l=l*n/g(l,n);return l;}
</code>```

Title: Least Common Multiple

Body:
The least common multiple of a set of positive integers A is the smallest postive integer B such that, for each k in A, there exists a positive integer n such that k*n = B.

Given at least two positive integers as input, output their least common multiple.

Rules

Builtins are allowed, but if your solution uses one, you are encouraged to include an alternate solution that does not use GCD/LCM builtins. However, the alternate solution will not count towards your score at all, so it is entirely optional.

All inputs and outputs will be within the natively-representable range for your language. If your language is natively capable of arbitrarily-large integers, then your solution must work with arbitrarily large inputs and outputs.

Test cases

```<code>[7, 2] -> 14
[8, 1] -> 8
[6, 4, 8] -> 24
[8, 2, 1, 10] -> 40
[9, 6, 2, 1, 5] -> 90
[5, 5, 7, 1, 1] -> 35
[4, 13, 8, 8, 11, 1] -> 1144
[7, 2, 2, 11, 11, 8, 5] -> 3080
[1, 6, 10, 3, 4, 10, 7] -> 420
[5, 2, 9, 10, 3, 4, 4, 4, 7] -> 1260
[9, 7, 10, 9, 7, 8, 5, 10, 1] -> 2520
</code>```

Body:
Java 8, <s>75</s> <s>59</s> <s>121</s> 89 bytes

Uses the Euclidean Algorithm and the fact that
LCM(A, B)= A * B / GCD(A, B)

16 bytes off. Thanks to @carusocomputing

Added Multi-Input +62 bytes

32 bytes off. Thanks to @Olivier Grégoire

Code:

public static int lcm(int l, int c){
  for(int i=1;i<=l&&i<=c;++i)
    if (i%l==0&&i%c==0)
      return l*c/i;
}
public static int lcm(int...x){
  int y=x[0];
  for(int j:x){
    y=lcm(j,y);
  }
  return y;
}

Remove line-breaks:

int g(int a,int b){return b<1?a:g(b,a%b);}

l->{int l=1;for(int n:a)l=l*n/g(l,n);return l;}


答:
JavaScript (ES6), 52 bytes

```<code>a=>a.reduce((l,n)=>l*n/(g=(m,n)=>n?g(n,m%n):m)(l,n))
</code>```

I reduced this answer as much as I could but I'm obviously not going to get anywhere near the simplicity of @Hedi's answer.

Title: Least Common Multiple

Body:
JavaScript (ES6), 52 bytes

a=>a.reduce((l,n)=>l*n/(g=(m,n)=>n?g(n,m%n):m)(l,n))

I reduced this answer as much as I could but I'm obviously not going to get anywhere near the simplicity of @Hedi's answer.


答:
Pyth, 25 bytes

```<code>+Pjmj\ dc*G\,j94092 23)\.
</code>```

A program that prints the result to STDOUT.

Try it online

How it works

```<code>+Pjmj\ dc*G\,j94092 23)\.  Program. Input: none
          G                Yield string literal'abcdefghijklmnopqrstuvwxyz'
         * \,              Cartesian product of that with ',', yielding a list of
                           characters with appended commas
             j94092 23)    Yield the integer 94092 in base-23, giving [7, 16, 19, 22]
        c                  Split the comma-appended character list at those indices
   mj\                     Join each element of that on spaces
  j                        Join that on newlines
 P                         All but the last element of that, removing trailing ','
+                      \.  Append '.'
                           Implicitly print
</code>```

Body:
Pyth, 25 bytes

+Pjmj\ dc*G\,j94092 23)\.

A program that prints the result to STDOUT.

Try it online

How it works

+Pjmj\ dc*G\,j94092 23)\.  Program. Input: none
          G                Yield string literal'abcdefghijklmnopqrstuvwxyz'
         * \,              Cartesian product of that with ',', yielding a list of
                           characters with appended commas
             j94092 23)    Yield the integer 94092 in base-23, giving [7, 16, 19, 22]
        c                  Split the comma-appended character list at those indices
   mj\                     Join each element of that on spaces
  j                        Join that on newlines
 P                         All but the last element of that, removing trailing ','
+                      \.  Append '.'
                           Implicitly print


问:
Leibniz golf in C#
I'm starting with golf code. But im only do C# so I know wont be a breaking record, but I want give it a try. Leibniz

Challenge is here

The first line contains the number of test cases (N) which is less than 100. Each additional line is a test case for a positive integer value (T) less than 10^7.

I format the code to easy the reading, removing spaces I reduce it to 210 chars.
The best code submit for this problem is 54 char, but For C# lenguaje the best is 172 chars.

My guess is should remove reading the N, but couldn't make it stop properly.

```<code>using System;
class S
{
    static void Main()
    {
        int n=Convert.ToInt32(Console.ReadLine()),i=0;
        for (;i++<n;)
        {
            double r=0,t=Convert.ToInt32(Console.ReadLine()),j=0;
            for(;j<t;)
                r+=(1-j%2*2)/(2*j+++1);
            Console.WriteLine(r);
        }
    }
}
</code>```

NOTE

Mono C# compiler 3.2.8.0 .NET 4.0 CLR

So using C=System.Console doesn't work.

答:
172 Characters

The permanent version of the challenge can be found here. I have the shortest solution for C#, which is 172 characters.

Golfed

using R=System.Console;class C{static void Main(){R.ReadLine();for(double s,n,j;;){for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;){s+=(j%2<1?1:-1)/(2*j+++1);}R.WriteLine(s);}}}
```
<h3>Ungolfed</h3>
<pre class="lang-c# prettyprint-override"><code>using R=System.Console;
class C
{
    static void Main()
    {
        R.ReadLine();
        for(double s,n,j;;)
        {
            for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;)
            {
                s+=(j%2<1?1:-1)/(2*j+++1);
            }
            R.WriteLine(s);
        }
    }
}
</code>```

It does error out on the last loop, but it's after outputting all test cases.

Edit

Seeing it ungolfed like this, just realized I can inline the for loop.

170 characters

Golfed

using R=System.Console;class C{static void Main(){R.ReadLine();for(double s,n,j;;){for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;)s+=(j%2<1?1:-1)/(2*j+++1);R.WriteLine(s);}}}
```
<h3>Ungolfed</h3>
<pre class="lang-c# prettyprint-override"><code>using R=System.Console;
class C
{
    static void Main()
    {
        R.ReadLine();
        for(double s,n,j;;)
        {
            for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;)
                s+=(j%2<1?1:-1)/(2*j+++1);
            R.WriteLine(s);
        }
    }
}
</code>```

Edit 2

@PeterTaylor's answer has some fantastic logic. Cleaned it up a bit, and I'm still using exceptions for control flow.

155 characters

Golfed

using R=System.Console;class C{static void Main(){R.ReadLine();for(double s,n;;R.WriteLine(s))for(s=0,n=2*int.Parse(R.ReadLine());n>0;n--)s-=(1-n%4)/--n;}}
```
<h3>Ungolfed</h3>
<pre class="lang-c# prettyprint-override"><code>using R = System.Console;
class C
{
    static void Main()
    {
        R.ReadLine();
        for(double s, n;; R.WriteLine(s))
            for(s = 0, n = 2 * int.Parse(R.ReadLine()); n > 0; n--)
                s -= (1 - n % 4) / --n;
    }
}
</code>```

I really wish I could get rid of the extra ReadLine().

Title: Leibniz golf in C#

Body:
172 Characters

The permanent version of the challenge can be found here. I have the shortest solution for C#, which is 172 characters.

Golfed

using R=System.Console;class C{static void Main(){R.ReadLine();for(double s,n,j;;){for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;){s+=(j%2<1?1:-1)/(2*j+++1);}R.WriteLine(s);}}}

Ungolfed

using R=System.Console;
class C
{
    static void Main()
    {
        R.ReadLine();
        for(double s,n,j;;)
        {
            for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;)
            {
                s+=(j%2<1?1:-1)/(2*j+++1);
            }
            R.WriteLine(s);
        }
    }
}

It does error out on the last loop, but it's after outputting all test cases.

Edit

Seeing it ungolfed like this, just realized I can inline the for loop.

170 characters

Golfed

using R=System.Console;class C{static void Main(){R.ReadLine();for(double s,n,j;;){for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;)s+=(j%2<1?1:-1)/(2*j+++1);R.WriteLine(s);}}}

Ungolfed

using R=System.Console;
class C
{
    static void Main()
    {
        R.ReadLine();
        for(double s,n,j;;)
        {
            for(s=0,n=int.Parse(R.ReadLine()),j=0;j<n;)
                s+=(j%2<1?1:-1)/(2*j+++1);
            R.WriteLine(s);
        }
    }
}

Edit 2

@PeterTaylor's answer has some fantastic logic. Cleaned it up a bit, and I'm still using exceptions for control flow.

155 characters

Golfed

using R=System.Console;class C{static void Main(){R.ReadLine();for(double s,n;;R.WriteLine(s))for(s=0,n=2*int.Parse(R.ReadLine());n>0;n--)s-=(1-n%4)/--n;}}

Ungolfed

using R = System.Console;
class C
{
    static void Main()
    {
        R.ReadLine();
        for(double s, n;; R.WriteLine(s))
            for(s = 0, n = 2 * int.Parse(R.ReadLine()); n > 0; n--)
                s -= (1 - n % 4) / --n;
    }
}

I really wish I could get rid of the extra ReadLine().


Body:
Brainfuck, 157 bytes

+++++[>+>+++<<-]>>[->+>++++>+++>++<<<<]>----->+++++.>-.>++.<<<<<+[->>>+.>.>.<<<<<]+++++++++>>.<<[->>>+.>.>.<<<<<]<---[+>+++>>.<<[->>>+.>.>.<<<<<]<]>>>>+.>++.

Try it online


答:
Brachylog, 17 bytes

```<code>,.#>=g:?z:%a#=h0,
</code>```

Try it online!

Explanation

```<code>,.#>=               Output is a strictly positive integer
     g:?z           Zip the Output with the Input
         :%a        Compute Output mod I for each I in the Input
            #=h0,   All results must be equal to 0
</code>```

Title: Least Common Multiple

Body:
Brachylog, 17 bytes

,.#>=g:?z:%a#=h0,

Try it online!

Explanation

,.#>=               Output is a strictly positive integer
     g:?z           Zip the Output with the Input
         :%a        Compute Output mod I for each I in the Input
            #=h0,   All results must be equal to 0


答:
Forth, 85 bytes

This is a function that prints the string. Checking for when to print a new line is costly. This is still shorter than simply printing the required string, because it has new lines in it. The code does not need to be on this many lines, but there does need to be a line break within the DO LOOP somewhere. I don't know why.

```<code>: f 90 65 DO
I 72 = I 81 = I 84 = I 87 = + + +
if CR then
I emit ." , "
LOOP ." Z." ;
</code>```

Try it online

The code is case-insensitive.

Body:
Forth, 85 bytes

This is a function that prints the string. Checking for when to print a new line is costly. This is still shorter than simply printing the required string, because it has new lines in it. The code does not need to be on this many lines, but there does need to be a line break within the DO LOOP somewhere. I don't know why.

: f 90 65 DO
I 72 = I 81 = I 84 = I 87 = + + +
if CR then
I emit ." , "
LOOP ." Z." ;

Try it online

The code is case-insensitive.


答:
Pip, 19 bytes

18 bytes of code, +1 for the -n flag. Outputs in lowercase.

```<code>(zJk).'.^@A*"?09B"
</code>```

The ? represents a non-printing character, ASCII code 21. Try it online!

Explanation

```<code> z                  Lowercase alphabet
  Jk                Join on ", "
(   ).'.            Append a period
          A*"?09B"  Map ascval() over that string, results in list: [21 48 57 66]
        ^@          Split at those indices
                    Join on newline and print (implicit, -n flag)
</code>```

Body:
Pip, 19 bytes

18 bytes of code, +1 for the -n flag. Outputs in lowercase.

(zJk).'.^@A*"?09B"

The ? represents a non-printing character, ASCII code 21. Try it online!

Explanation

 z                  Lowercase alphabet
  Jk                Join on ", "
(   ).'.            Append a period
          A*"?09B"  Map ascval() over that string, results in list: [21 48 57 66]
        ^@          Split at those indices
                    Join on newline and print (implicit, -n flag)


Title: Least Common Multiple

Body:
PHP, 65 Bytes

<?for($t=1;$t&&++$i;$t=!$t)foreach($_GET as$v)$t*=$i%$v<1;echo$i;

Try it online!

or

for(;++$i;!$t?:die("$i"))for($n=$t=1;$v=$argv[$n++];)$t*=$i%$v<1;

or

<?for($t=1;++$i;$t=!$t?:die("$i"))foreach($_GET as$v)$t*=$i%$v<1;

PHP, 96 Bytes

with 2 loops

while(1<count($a=&$_GET[i])){$e=array_pop($a);for($i=0;($m=++$i*$e)%$a[0];);$a[0]=$m;}echo$a[0];

based on set theory 128 Bytes

$p=array_product($a=$_GET[i]);echo min(array_intersect(...array_map($r=function($n)use($p){return range($n,$p,$n);},$_GET[i])));


答:
Pyth, 9 bytes

```<code>.U/*bZibZ
</code>```

A program that takes input of a list on STDIN and prints the result.

Try it online or verify all test cases

How it works

```<code>.U/*bZibZ  Program. Input: Q
.U         Reduce Q by (implicit input fill):
   *bZ      Product of current and next value
  /   ibZ   divided by GCD of current and next value
           Implicitly print
</code>```

Title: Least Common Multiple

Body:
Pyth, 9 bytes

.U/*bZibZ

A program that takes input of a list on STDIN and prints the result.

Try it online or <a href="http://pyth.herokuapp.com/?code=j%22+-%3E+%22%2CQ.U%2F%2abZibZ&test_suite=1&test_suite_input=%5B7%2C+2%5D%0A%5B8%2C+1%5D%0A%5B6%2C+4%2C+8%5D%0A%5B8%2C+2%2C+1%2C+10%5D%0A%5B9%2C+6%2C+2%2C+1%2C+5%5D%0A%5B5%2C+5%2C+7%2C+1%2C+1%5D%0A%5B4%2C+13%2C+8%2C+8%2C+11%2C+1%5D%0A%5B7%2C+2%2C+2%2C+11%2C+11%2C+8%2C+5%5D%0A%5B1%2C+6%2C+10%2C+3%2C+4%2C+10%2C+7%5D%0A%5B5%2C+2%2C+9%2C+10%2C+3%2C+4%2C+4%2C+4%2C+7%5D%0A%5B9%2C+7%2C+10%2C+9%2C+7%2C+8%2C+5%2C+10%2C+1%5D&debug=0" rel="nofollow noreferrer">verify all test cases

How it works

.U/*bZibZ  Program. Input: Q
.U         Reduce Q by (implicit input fill):
   *bZ      Product of current and next value
  /   ibZ   divided by GCD of current and next value
           Implicitly print


答:
Haskell, 10 bytes

```<code>foldr1 lcm
</code>```

Usage example: foldl1 lcm [5,2,9,10,3,4,4,4,7] -> 1260.

Title: Least Common Multiple

Body:
Haskell, 10 bytes

foldr1 lcm

Usage example: foldl1 lcm [5,2,9,10,3,4,4,4,7] -> 1260.


答:
05AB1E, <s>8</s> 7 bytes

```<code>)IF)©`®
</code>```

Explanation

```<code>)         # wrap stack in a list, as stack is empty this becomes the empty list []
 IF       # input number of times do:
   )      # wrap stack in list
    ©     # store a copy of the list in the register
     `    # flatten the list
      ®   # push the copy from the register
          # implicitly print top value of stack after the last loop iteration
</code>```

Try it online!

Saved 1 byte thanks to Adnan.

Title: Natural construction

Body:
The natural numbers including 0 are formally defined as sets, in the following way:

Number 0 is defined as the empty set, {}

For n ≥ 0, number n+1 is defined as n ∪ {n}.

As a consequence, n = {0, 1, ..., n-1}.

The first numbers, defined by this procedure, are:

0 = {}

1 = {{}}

2 = {{}, {{}}}

3 = {{}, {{}}, {{}, {{}}}}

Challenge

Given n, output its representation as a set.

Rules

The output can consistently use any bracket character such as {}, [], () or <>. Arbitrary characters (such as 01) are not allowed.

Instead of a comma as above, the separator can be any punctuation sign; or it may be inexistent.

Spaces (not newlines) may be included arbitrarily and inconsistently.

For example, number 2 with square brackets and semicolon as separator is [[]; [[]]], or equivalently [ [ ]; [ [ ] ] ], or even [  [ ] ;[  []]]

The order in which elements of a set are specified doesn't matter. So you can use any order in the representation. For example, these are some valid outputs for 3:

```<code>{{},{{}},{{},{{}}}}
{{{}},{{},{{}}},{}}
{{{}},{{{}},{}},{}}
</code>```

You can write a program or function. Output may be a string or, if using a function, you may return a nested list or array whose string representation conforms to the above.

Test cases

```<code>0  ->  {}
1  ->  {{}}
2  ->  {{},{{}}}
3  ->  {{},{{}},{{},{{}}}}
4  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}
5  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}
6  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}}
7  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}}}
</code>```

Body:
05AB1E, <s>8</s> 7 bytes

)IF)©`®

Explanation

)         # wrap stack in a list, as stack is empty this becomes the empty list []
 IF       # input number of times do:
   )      # wrap stack in list
    ©     # store a copy of the list in the register
     `    # flatten the list
      ®   # push the copy from the register
          # implicitly print top value of stack after the last loop iteration

Try it online!

Saved 1 byte thanks to Adnan.


问:
Yes, of course I'm an adult!
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.

In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.

Input:

Your program/function accepts a positive integer or decimal.

Output:

Is the input an integer >= 18? Simply print the input.

Is the input an integer 0-17? Print 18.

Is the input a decimal >= 1.4? Simply print the input.

Is the input a decimal 0.0-1.4? Print 1.4.

Challenge rules:

Assume the input will always be in the range of 0-122 (oldest woman ever was 122) or 0.0-2.72 (tallest man ever was 2.72).

You are allowed to take the input as a String, object, or anything else you prefer.

The decimal inputs will never have more than three decimal places after the decimal point.

2 or 2. both aren't valid outputs for 2.0. You are free to output 2.00 or 2.000 instead of 2.0 however.

Just like the input the output will never have more than three decimal places after the point.

General rules:

This is code-golf, so shortest answer in bytes wins.

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122

0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
</code>```

答:
Haskell, 49 bytes

```<code>x#y=show.max x.fst<$>reads y;f s=head$18#s++1.4#s
</code>```

Basically, this first attempts to read the input as an integer and then as a double if that fails. Then proceeds to compare it to the respective comparison baseline.

Title: Yes, of course I'm an adult!

Body:
Haskell, 49 bytes

x#y=show.max x.fst<$>reads y;f s=head$18#s++1.4#s

Basically, this first attempts to read the input as an integer and then as a double if that fails. Then proceeds to compare it to the respective comparison baseline.


答:
Pyth, 4 bytes

```<code>LyMb
</code>```

Test suite

L: Define the function y with input b

yMb: y mapped over the range 0, 1, ..., b-1

On the input 0, this map returns []. Otherwise, it returns y mapped over all numbers up to b.

Title: Natural construction

Body:
Pyth, 4 bytes

LyMb

Test suite

L: Define the function y with input b

yMb: y mapped over the range 0, 1, ..., b-1

On the input 0, this map returns []. Otherwise, it returns y mapped over all numbers up to b.


答:
Python 2, 26 bytes

f=lambda n:map(f,range(n))
```

Test it on Ideone.

Title: Natural construction

Body:
Python 2, 26 bytes

f=lambda n:map(f,range(n))

Test it on Ideone.


问:
"Hello, World!"
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of <s>Wikipedia</s> (the Wikipedia entry has been deleted but there is a copy at archive.org
), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

The Rules

Each submission must be a full program.

The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.

The program must not write anything to STDERR.

If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code>## Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code>## Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code>## Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the snippet:

```<code>## [><>](https://esolangs.org/wiki/Fish), 121 bytes
</code>```

/* Configuration */

var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 500px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Logy, 32 bytes

```<code>main[_]->print["Hello, World!"];
</code>```

Define the rule main printing Hello, World!.

EDIT: Now puts need to be included, so I need to use print

Title: "Hello, World!"

Body:
Logy, 32 bytes

main[_]->print["Hello, World!"];

Define the rule main printing Hello, World!.

EDIT: Now puts need to be included, so I need to use print


答:
MATL, 13 bytes

```<code>Xhi:"tY:Xh]&D
</code>```

Try it online!

Explanation

```<code>Xh              % Concatenate the stack contents into cell array. Since the stack
                % is empty, this produces the empty cell array, {}
  i:"     ]     % Take input number. Repeat that many times
     t          % Duplicate the cell array that is at the top of the stack
      Y:        % Unbox it, i.e., push its contents onto the stack
        Xh      % Concatenate the stack contents into a cell array
           &D   % String representation. Implicitly display
</code>```

Title: Natural construction

Body:
MATL, 13 bytes

Xhi:"tY:Xh]&D

Try it online!

Explanation

Xh              % Concatenate the stack contents into cell array. Since the stack
                % is empty, this produces the empty cell array, {}
  i:"     ]     % Take input number. Repeat that many times
     t          % Duplicate the cell array that is at the top of the stack
      Y:        % Unbox it, i.e., push its contents onto the stack
        Xh      % Concatenate the stack contents into a cell array
           &D   % String representation. Implicitly display


答:
Jelly, 3 bytes

```<code>Ḷß€
</code>```

This is a monadic link. Try it online!

How it works

Each natural number is the set of all previous natural numbers, i.e., n = {0, …, n-1}. Since there are no natural numbers preceding 0, we have that 0 = {}.

```<code>Ḷß€  Monadic link. Argument: n (natural number)

Ḷ    Unlength; yield [0, ..., n-1].
 ß€  Recursively map this link over the range.
</code>```

Title: Natural construction

Body:
Jelly, 3 bytes

Ḷß€

This is a monadic link. Try it online!

How it works

Each natural number is the set of all previous natural numbers, i.e., n = {0, …, n-1}. Since there are no natural numbers preceding 0, we have that 0 = {}.

Ḷß€  Monadic link. Argument: n (natural number)

Ḷ    Unlength; yield [0, ..., n-1].
 ß€  Recursively map this link over the range.


答:
Ruby, 57 bytes

```<code>26.times{|i|$><<(i+65).chr+",."[i/25]+"
"[2392128>>i&1]}
</code>```

The space at the end of the first line is required: it's a literal [space][newline.]

C,74 bytes

```<code>c;main(){for(;++c<27;)printf("%c%c%c",64+c,44+c/26*2,4784256>>c&1?10:32);}
</code>```

Basic bitshift and mask to determine when to print a space and when to print a newline. I noted that with the A and Z removed all groups are a multiple of 3 letters long, but I was unable to make use of this.

Body:
Write a program or function that outputs this exact text, case-insensitive:

```<code>A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

This is code-golf, so the shortest code in bytes wins.

Body:
Ruby, 57 bytes

26.times{|i|$><<(i+65).chr+",."[i/25]+"
"[2392128>>i&1]}

The space at the end of the first line is required: it's a literal [space][newline.]

C,74 bytes

c;main(){for(;++c<27;)printf("%c%c%c",64+c,44+c/26*2,4784256>>c&1?10:32);}

Basic bitshift and mask to determine when to print a space and when to print a newline. I noted that with the A and Z removed all groups are a multiple of 3 letters long, but I was unable to make use of this.


答:
JavaScript (ES6), 32 bytes

```<code>f=n=>[...Array(n).keys()].map(f)
</code>```

Simple enough.

Title: Natural construction

Body:
JavaScript (ES6), 32 bytes

f=n=>[...Array(n).keys()].map(f)

Simple enough.


答:
k, 20 bytes

Returns the maximum of the input, x, and 18 if x is integral or 1.4 otherwise.

```<code>{x|$[-7h=@x;18;1.4]}
</code>```

Title: Yes, of course I'm an adult!

Body:
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.

In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.

Input:

Your program/function accepts a positive integer or decimal.

Output:

Is the input an integer >= 18? Simply print the input.

Is the input an integer 0-17? Print 18.

Is the input a decimal >= 1.4? Simply print the input.

Is the input a decimal 0.0-1.4? Print 1.4.

Challenge rules:

Assume the input will always be in the range of 0-122 (oldest woman ever was 122) or 0.0-2.72 (tallest man ever was 2.72).

You are allowed to take the input as a String, object, or anything else you prefer.

The decimal inputs will never have more than three decimal places after the decimal point.

2 or 2. both aren't valid outputs for 2.0. You are free to output 2.00 or 2.000 instead of 2.0 however.

Just like the input the output will never have more than three decimal places after the point.

General rules:

This is code-golf, so shortest answer in bytes wins.

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122

0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
</code>```

Body:
k, 20 bytes

Returns the maximum of the input, x, and 18 if x is integral or 1.4 otherwise.

{x|$[-7h=@x;18;1.4]}


答:
Ruby, <s>27</s> 21 bytes

I'm new to ruby golfing, but here goes nothing. Thanks to Jordan for saving 6 bytes!

```<code>f=->s{(0...s).map &f}
</code>```

This is a recursive function f (a proc, to be specific) and takes an argument s. It maps the proc f over 0...s, which is the range [0, s).

Title: Natural construction

Body:
Ruby, <s>27</s> 21 bytes

I'm new to ruby golfing, but here goes nothing. Thanks to Jordan for saving 6 bytes!

f=->s{(0...s).map &f}

This is a recursive function f (a proc, to be specific) and takes an argument s. It maps the proc f over 0...s, which is the range [0, s).


答:
CJam, 14 bytes

```<code>"[]"{_)@\]}ri*
</code>```

Try it online!

Explanation

```<code>"[]"            e# Push this string. It is the representation of 0, and also serves
                e# to initialize
    {     }ri*  e# Repeat this block as many times as the input number
     _          e# Duplicate
      )         e# Uncons: split into array without the last element, and last element
       @\       e# Rotate, swap
         ]      e# Pack stack contents into an array
                e# Implicitly display
</code>```

In each iteration, the block builds the representation of a number from that of the preceding one. To illustrate, let's consider the second iteration, where the representation of number 2 is built from that of 1, which is the string "[[]]".

The stack contains "[[]]"

After statement _ (duplicate) it contains "[[]]", "[[]]"

After statement ) (uncons) it contains "[[]]", "[[]", "]"

After statement @ (rotate) it contains "[[]", "]", "[[]]"

After statement \ (swap) it contains "[[]", "[[]]", "]"

After statement ] (pack into array) it contains ["[[]" "[[]]" "]"], which would be displayed as the string "[[][[]]]".

Title: Natural construction

Body:
CJam, 14 bytes

"[]"{_)@\]}ri*

Try it online!

Explanation

"[]"            e# Push this string. It is the representation of 0, and also serves
                e# to initialize
    {     }ri*  e# Repeat this block as many times as the input number
     _          e# Duplicate
      )         e# Uncons: split into array without the last element, and last element
       @\       e# Rotate, swap
         ]      e# Pack stack contents into an array
                e# Implicitly display

In each iteration, the block builds the representation of a number from that of the preceding one. To illustrate, let's consider the second iteration, where the representation of number 2 is built from that of 1, which is the string "[[]]".

The stack contains "[[]]"

After statement _ (duplicate) it contains "[[]]", "[[]]"

After statement ) (uncons) it contains "[[]]", "[[]", "]"

After statement @ (rotate) it contains "[[]", "]", "[[]]"

After statement \ (swap) it contains "[[]", "[[]]", "]"

After statement ] (pack into array) it contains ["[[]" "[[]]" "]"], which would be displayed as the string "[[][[]]]".


答:
PHP, 881 Bytes

```<code><?=json_decode(gzinflate(base64_decode("rVY9rxQxDPwr0Ta5E0lWQHcCJBAUNHcFiCoi217xeBIFDea/M3acr80eFXlPG6094x07TnK/l5fLZTH7QYbiz/hjsCUXvMVfcKn5kgzqqdmkEOdtiWiun69fP10/3ozCNx8E5RiSJg11bAKLK6Mg7Bh5+n7GM0aGksmoQVfBvTmb07tzzi/GrLjhTl/Oef6A+fRLYq4ScwtjIORYOO+F4yzpx5FYLoJYkZpws0kKUoBaGE4R8ylBVq5GKdEE5BQ3ju6sFOSf0JIWPQTuYrRvdFB9KdA91lS/LCbEOWtGV0fO/qm39lF2Q0iLW14d9aoJPi7aSrMjRz3041uwK3Lu96yZIRJmApScdC7+rGb213o1ub2+PTrDpwyoCo5LLlkrLR3mBKv1JQ5TGgGMuNo5y6y0LB721NrlpYwqcWinShmEm4eE1mlTXsf4QqBOMxKsYWaCMqg+OsIOTlrROOGVscebRtjjhTHhG6HhL6hWzxvwldDwEiU8wrc912vqCAK3XG46LrdoD8rAka99jXJT10U7Qu5hWfZ5I02LY478j9zaQtSLmRGsDSfE6+mEeK6U54LuzpijY0ds40EEUzWkYWQjBd+NoFnQ0A/0H629Aryp+XYzIQ9z41u2XLA4AGSkgIsJM66kgE3c5yMfkrhx1XC868GA5woPmG0lOY6AgPE2teRDsl5RziLY3d+1RgiL5UvdrwBAEQVYizDpBa/P5XLRG3zzd1if+OzBg/h/fevk5e4t8Q8U2X03lkBlC6ASEQnIg7/LM1p5JflFoyeZrGU+1pi2eWuGAVlic/n123HL8S3PlVz+/AU=")),1)[$argv[1]];
</code>```

Making of fill the lines with the graphics use the heredoc syntax in PHP

```<code>$a[1]=<<<A

A;
$a[2]=<<<B

B;
$a[3]=<<<C

C;
echo base64_encode(gzdeflate(json_encode($a)));
</code>```

Title: Some ASCII art for N64's 20th B-Day

Body:
The official release of the Nintendo 64 in North America was on September 29, 1996.[1] I figured that this anniversary deserved an ASCII art challenge. There's one small twist though, you have to output a different ASCII art for each of three different inputs.

If the input is 1, output this ASCII art of an N64 Controller: (source)

```<code>                 | |
             _,.-'-'-.,_
      ______|           |______
   ,-'      |  NINTENDO |      `-.
 ,'   _                          `.
/   _| |_                     (^)   \
|  |_   _|                  (<) (>) |
\    |_|         (S)     (B)  (v)   /
|`.              ___       (A)    ,'|
|  `-.______   ,' _ `.   ______,-'  |
|      |    `. | (_) | ,'    |      |
|      |      \`.___,'/      |      |
|      |      |       |      |      |
|      /      |       |      \      |
\     /       |       |       \     /
 `._,'        \       /        `._,'
               \     /
                `._,'
</code>```

If the input is 2, output this ASCII art of the N64 logo:(source)

```<code>                  .-"-.
               .-"     "-.
              /"-.     .-|
             /    "-.-"  |
            /      /     |
   .-"-.   /      /      |       .-"-.
.-"     "-/      /       |    .-"     "-.
|-.     .-"\    /        |   /"-.     .-|
|  '-.-"    \  /         | /'    "-.-"  |
|     \      \/   .-"-.  /'        |    |
|      \      \.-"     "-.         |    |
|       \      |-.     .-"\        |    |
|        \     |  "-.-"    '\      |    |
|         \    |    |        '\    |    |
|    |\    \   |    |          '\  |    |
|    | \    \  |    |            '\|    |
|    |  \    \ |    |    :\.            |
|    |   \    \|    |    |  \.          |
|    |    \         |    |    \.        |
'-.  |  .-"\        |    |    '.\.    .-'
   "-|-"    \       |    |      "-\.-"
             \      |    |
              \     |    |
               "-.  |  .-'
                  "-|-"
</code>```

Finally, if the input is 3, outout this ASCII art of a console and TV: (source)

```<code>              o
     o       /
      \     /
       \   /
        \ /
   ______________
  |.------------.|
  ||            ||
  ||            ||
  ||            ||
  ||            ||
  ||____________||_
  |OO ....... OO | `-.
  '------_.-._---' _.'
   _____||   ||___/_
  /  _.-|| N ||-._  \      .-._
 / -'_.---------._'- \    ,'___i-i___
/_.-'_  NINTENDO _'-._\  ' /_+  o :::\
|`-i /m\/m\|\|/=,/m\i-'| | || \ O / ||
|  |_\_/\_/___\_/'./|  | | \/  \ /  \/
`-'              '-.`-'  ,      V
                    `---'
</code>```

Rules:

Input may be either as a number or a string/char.

You may have any amount of leading or trailing spaces and trailing or leading newlines. (Output must be aligned correctly though)

Your submission may be either a full program or a function.

No retrieving the ASCII art from the internet.

This is code-golf, so smallest byte count wins.

Body:
PHP, 881 Bytes

<?=json_decode(gzinflate(base64_decode("rVY9rxQxDPwr0Ta5E0lWQHcCJBAUNHcFiCoi217xeBIFDea/M3acr80eFXlPG6094x07TnK/l5fLZTH7QYbiz/hjsCUXvMVfcKn5kgzqqdmkEOdtiWiun69fP10/3ozCNx8E5RiSJg11bAKLK6Mg7Bh5+n7GM0aGksmoQVfBvTmb07tzzi/GrLjhTl/Oef6A+fRLYq4ScwtjIORYOO+F4yzpx5FYLoJYkZpws0kKUoBaGE4R8ylBVq5GKdEE5BQ3ju6sFOSf0JIWPQTuYrRvdFB9KdA91lS/LCbEOWtGV0fO/qm39lF2Q0iLW14d9aoJPi7aSrMjRz3041uwK3Lu96yZIRJmApScdC7+rGb213o1ub2+PTrDpwyoCo5LLlkrLR3mBKv1JQ5TGgGMuNo5y6y0LB721NrlpYwqcWinShmEm4eE1mlTXsf4QqBOMxKsYWaCMqg+OsIOTlrROOGVscebRtjjhTHhG6HhL6hWzxvwldDwEiU8wrc912vqCAK3XG46LrdoD8rAka99jXJT10U7Qu5hWfZ5I02LY478j9zaQtSLmRGsDSfE6+mEeK6U54LuzpijY0ds40EEUzWkYWQjBd+NoFnQ0A/0H629Aryp+XYzIQ9z41u2XLA4AGSkgIsJM66kgE3c5yMfkrhx1XC868GA5woPmG0lOY6AgPE2teRDsl5RziLY3d+1RgiL5UvdrwBAEQVYizDpBa/P5XLRG3zzd1if+OzBg/h/fevk5e4t8Q8U2X03lkBlC6ASEQnIg7/LM1p5JflFoyeZrGU+1pi2eWuGAVlic/n123HL8S3PlVz+/AU=")),1)[$argv[1]];

Making of fill the lines with the graphics use the heredoc syntax in PHP

$a[1]=<<<A

A;
$a[2]=<<<B

B;
$a[3]=<<<C

C;
echo base64_encode(gzdeflate(json_encode($a)));


问:
Triangular Square Numbers
Square numbers are those that take the form of \$n^2\$ where \$n\$ is an integer. These are also called perfect squares, because when you take their square root you get an integer.

The first 10 square numbers are: (OEIS)

0, 1, 4, 9, 16, 25, 36, 49, 64, 81

Triangular numbers are numbers that can form an equilateral triangle. The n-th triangle number is equal to the sum of all natural numbers from 1 to n.

The first 10 triangular numbers are: (OEIS)

0, 1, 3, 6, 10, 15, 21, 28, 36, 45

Square triangular numbers are numbers that are both square and triangular.

The first 10 square triangular numbers are: (OEIS)

0, 1, 36, 1225, 41616, 1413721, 48024900, 1631432881, 55420693056, 1882672131025, 63955431761796

There is an infinite number of square numbers, triangle numbers, and square triangular numbers.

Write a program or named function that given an input (parameter or stdin) number \$n\$, calculates the \$n\$th square triangular number and outputs/returns it, where n is a positive nonzero number. (For \$n=1\$ return 0)

For the program/function to be a valid submission it should be able to return at least all square triangle numbers smaller than \$2^{31}-1\$.

Bonus

-4 bytes for being able to output all square triangular numbers less than 2^63-1

-4 bytes for being able to theoretically output square triangular numbers of any size.

<s>+8 byte penalty for solutions that take nonpolynomial time.</s>

Bonuses stack.

This is code-golf challenge, so the answer with the fewest bytes wins.

答:
Oasis, 7 - 4 - 4 = -1

```<code>34*c-»T
</code>```

Try it online!

Uses a(0) = 0, a(1) = 1; for n >= 2, a(n) = 34 * a(n-1) - a(n-2) + 2

Oasis supports arbitrary precision integers, so it should be able to go up to any number so long as no stack overflowing occurs. Let me know if this does not count for the bonus because of stack overflowing. It is also possible that this particular algorithm is non-polynomial, and let me know if that is the case.

Explanation:

```<code>34*c-»T -> 34*c-»10

a(0) = 0
a(1) = 1
a(n) = 34*c-»

34*c-»
34*    # 34*a(n-1)
   c-  # 34*a(n-1)-a(n-2)
     » # 34*a(n-1)-a(n-2)+2
</code>```

Alternative solution:

```<code>-35*d+T
</code>```

Instead uses a(n) = 35*(a(n-1)-a(n-2)) + a(n-3)

Title: Triangular Square Numbers

Body:
Oasis, 7 - 4 - 4 = -1

34*c-»T

Try it online!

Uses a(0) = 0, a(1) = 1; for n >= 2, a(n) = 34 * a(n-1) - a(n-2) + 2

Oasis supports arbitrary precision integers, so it should be able to go up to any number so long as no stack overflowing occurs. Let me know if this does not count for the bonus because of stack overflowing. It is also possible that this particular algorithm is non-polynomial, and let me know if that is the case.

Explanation:

34*c-»T -> 34*c-»10

a(0) = 0
a(1) = 1
a(n) = 34*c-»

34*c-»
34*    # 34*a(n-1)
   c-  # 34*a(n-1)-a(n-2)
     » # 34*a(n-1)-a(n-2)+2

Alternative solution:

-35*d+T

Instead uses a(n) = 35*(a(n-1)-a(n-2)) + a(n-3)


Title: Natural construction

Body:
The natural numbers including 0 are formally defined as sets, in the following way:

Number 0 is defined as the empty set, {}

For n ≥ 0, number n+1 is defined as n ∪ {n}.

As a consequence, n = {0, 1, ..., n-1}.

The first numbers, defined by this procedure, are:

0 = {}

1 = {{}}

2 = {{}, {{}}}

3 = {{}, {{}}, {{}, {{}}}}

Challenge

Given n, output its representation as a set.

Rules

The output can consistently use any bracket character such as {}, [], () or <>. Arbitrary characters (such as 01) are not allowed.

Instead of a comma as above, the separator can be any punctuation sign; or it may be inexistent.

Spaces (not newlines) may be included arbitrarily and inconsistently.

For example, number 2 with square brackets and semicolon as separator is [[]; [[]]], or equivalently [ [ ]; [ [ ] ] ], or even [  [ ] ;[  []]]

The order in which elements of a set are specified doesn't matter. So you can use any order in the representation. For example, these are some valid outputs for 3:

```<code>{{},{{}},{{},{{}}}}
{{{}},{{},{{}}},{}}
{{{}},{{{}},{}},{}}
</code>```

You can write a program or function. Output may be a string or, if using a function, you may return a nested list or array whose string representation conforms to the above.

Test cases

```<code>0  ->  {}
1  ->  {{}}
2  ->  {{},{{}}}
3  ->  {{},{{}},{{},{{}}}}
4  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}
5  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}
6  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}}
7  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}}}
</code>```

Body:
Haskell, <s>32</s> 27 bytes

p n='{':(p=<<[0..n-1])++"}"

Try it on Ideone.


答:
05AB1E, 18 bytes

```<code>SD¥X‹X¸«DgL*ê¥£OÙg
</code>```

Explanation

N = 12012 used as example.

```<code>                    # implicit input N = 12012
S                   # split input number to list of digits
                    # STACK: [1,2,0,1,2]
 D                  # duplicate
                    # STACK: [1,2,0,1,2], [1,2,0,1,2]
  ¥                 # reduce by subtraction
                    # STACK: [1,2,0,1,2], [1,-2,1,1]
   X‹               # is less than 1
                    # STACK: [1,2,0,1,2], [0,1,0,0]
     X¸«            # append 1
                    # STACK: [1,2,0,1,2], [0,1,0,0,1]
        DgL*        # multiply by index (1-indexed)
                    # STACK: [1,2,0,1,2], [0,2,0,0,5]
            ê       # sorted unique
                    # STACK: [1,2,0,1,2], [0,2,5]
             ¥      # reduce by subtraction
                    # STACK: [1,2,0,1,2], [2,3]
              £     # split into chunks
                    # STACK: [[1,2],[0,1,2]]
               O    # sum each
                    # STACK: [3,3]
                Ù   # unique
                    # STACK: [3]
                 g  # length, 1 is true in 05AB1E
                    # STACK: 1
</code>```

Try it online!

Title: Dennis numbers 2.0

Body:
PPCG user and elected mod, @Dennis just became the second ever user to earn over 100k rep!

This is a totally original idea, that I did not get from anybody else, but let's make a challenge based off of his user ID, 12012 as a tribute!

Looking at it, you'll notice that there are two distinct "sections" to his ID.

12

and

012

Both of these sections add up to a 3. That's a pretty interesting property.

Let's define a "Dennis 2.0 number" as any positive integer where every maximal subsequence of strictly increasing digits sums to the same number. For example,

```<code>123
</code>```

is a Dennis 2.0 number because there is only one maximal sublist of strictly increasing digits, and it sums to 6. Additionally, 2,846,145 is also a Dennis 2.0 number because the three maximal sublists of increasing digits, namely

```<code>28
46
145
</code>```

All sum to 10. Additionally, numbers that just repeat the same digit must be Dennis 2.0 numbers because, for example, 777 can be broken down into

```<code>7
7
7
</code>```

which clearly all sum to seven.

A number such as 42 is not a Dennis 2.0 number, since it is broken down into

```<code>4
2
</code>```

which clearly do not sum to the same number.

The challenge

You must write a program or function to determine if a given number is a Dennis 2.0 number or not. You can take input and output in any reasonable input format, e.g. as a string, as a number, from a file, funtion arguments/return, from STDIN/STDOUT, etc. and then return a truthy value if this number is a Dennis 2.0 number, and a falsy value if it is not. For reference, here is every Dennis 2.0 number up to 1,000:

```<code>1
2
3
4
5
6
7
8
9
11
12
13
14
15
16
17
18
19
22
23
24
25
26
27
28
29
33
34
35
36
37
38
39
44
45
46
47
48
49
55
56
57
58
59
66
67
68
69
77
78
79
88
89
99
101
111
123
124
125
126
127
128
129
134
135
136
137
138
139
145
146
147
148
149
156
157
158
159
167
168
169
178
179
189
202
222
234
235
236
237
238
239
245
246
247
248
249
256
257
258
259
267
268
269
278
279
289
303
312
333
345
346
347
348
349
356
357
358
359
367
368
369
378
379
389
404
413
444
456
457
458
459
467
468
469
478
479
489
505
514
523
555
567
568
569
578
579
589
606
615
624
666
678
679
689
707
716
725
734
777
789
808
817
826
835
888
909
918
927
936
945
999
</code>```

Standard loopholes apply, and the shortest answer measured in bytes wins!

Body:
05AB1E, 18 bytes

SD¥X‹X¸«DgL*ê¥£OÙg

Explanation

N = 12012 used as example.

                    # implicit input N = 12012
S                   # split input number to list of digits
                    # STACK: [1,2,0,1,2]
 D                  # duplicate
                    # STACK: [1,2,0,1,2], [1,2,0,1,2]
  ¥                 # reduce by subtraction
                    # STACK: [1,2,0,1,2], [1,-2,1,1]
   X‹               # is less than 1
                    # STACK: [1,2,0,1,2], [0,1,0,0]
     X¸«            # append 1
                    # STACK: [1,2,0,1,2], [0,1,0,0,1]
        DgL*        # multiply by index (1-indexed)
                    # STACK: [1,2,0,1,2], [0,2,0,0,5]
            ê       # sorted unique
                    # STACK: [1,2,0,1,2], [0,2,5]
             ¥      # reduce by subtraction
                    # STACK: [1,2,0,1,2], [2,3]
              £     # split into chunks
                    # STACK: [[1,2],[0,1,2]]
               O    # sum each
                    # STACK: [3,3]
                Ù   # unique
                    # STACK: [3]
                 g  # length, 1 is true in 05AB1E
                    # STACK: 1

Try it online!


答:
Jelly, <s>28 27 25</s> 19 bytes

-3 Thanks to caird coinheringaahing

```<code>ḟØẎṣ”Aṣ€”OVr/€FfJ}ị
</code>```

A dyadic Link accepting the range clause on the left and the array on the right (both as lists of characters) that yields the resulting list of characters.

TryItOnline

How?

```<code>ḟØẎṣ”Aṣ€”OVr/€FfJ}ị - Link: range-clause, C; array, W
 ØẎ                 - upper-case consonants ['B','C','D','F',...,'Z']
ḟ                   - filter remove (from C) (i.e. TO->O, AND->A)
   ṣ”A              - split at 'A's
      ṣ€”O          - split each at 'O's      e.g. [["-1","2"],["7"]]
          V         - evaluate as Jelly code       [[-1,2],[7]]
            /€      - rescue each by:
           r        -   inclusive range            [[-1,0,1,2],[7]]
              F     - flatten                      [-1,0,1,2,7]
                J}  - range of length (of W)
               f    - filter keep (those of F that are in bounds of W)
                  ị - index into (W)
</code>```

Title: Interpret loose ranges

Body:
Interpret loose ranges

ListSharp is an interpreted programming language that has many features, one of those features is a 1 index based range creator that works like this:

You define a range as (INT) TO (INT) or just (INT) where both or the single int can go from min to max int32 value

Then you can use those ranges to extract elements of an array without fearing to overstep it's boundaries

therefore:

1 TO 5 generates: {1,2,3,4,5}

3 generates: {3}

Ranges can be added up using the AND operator

1 TO 5 AND 3 TO 6 generates: {1,2,3,4,5,3,4,5,6}

remember this works with negative numbers as well

3 TO -3 generates: {3,2,1,0,-1,-2,-3}

The challenge is the following:

Input

A character array and the previously defined range clause as a string

Output

The elements at the 1 index based locations of the range (non existing/negative indexes translate to an empty character)

How to win

As a code-golf challenge you are supposed to create the program with the shortest byte count to win

It has been pointed out empty characters do not exist, therefore you should be ignoring them (I only showed them here to make it easier to understand yet it confused people)

Test cases:

```<code>input array is:
{'H','e','l','l','o',' ','W','o','r','l','d'}

range clause:
"1 TO 3" => "Hel"
"5" => "o"
"-10 TO 10" => "Hello Worl"
"0 AND 2 AND 4" => "el"
"8 TO 3" => "oW oll"
"-300 AND 300" => ""
"1 TO 3 AND 3 TO 1" => "HelleH"
"-20 TO 0 AND 1 AND 4" => "Hl"
</code>```

Body:
Jelly, <s>28 27 25</s> 19 bytes

-3 Thanks to caird coinheringaahing

ḟØẎṣ”Aṣ€”OVr/€FfJ}ị

A dyadic Link accepting the range clause on the left and the array on the right (both as lists of characters) that yields the resulting list of characters.

TryItOnline

How?

ḟØẎṣ”Aṣ€”OVr/€FfJ}ị - Link: range-clause, C; array, W
 ØẎ                 - upper-case consonants ['B','C','D','F',...,'Z']
ḟ                   - filter remove (from C) (i.e. TO->O, AND->A)
   ṣ”A              - split at 'A's
      ṣ€”O          - split each at 'O's      e.g. [["-1","2"],["7"]]
          V         - evaluate as Jelly code       [[-1,2],[7]]
            /€      - rescue each by:
           r        -   inclusive range            [[-1,0,1,2],[7]]
              F     - flatten                      [-1,0,1,2,7]
                J}  - range of length (of W)
               f    - filter keep (those of F that are in bounds of W)
                  ị - index into (W)