问:
A day at the Horse Races

Background

Back in the late 90's / first 00's when Flash Web Design was so much cool that noone could live without having a full Flash website, or at least an animated widget, I was hired to develop a "horse races viewer" in Flash/Actionscript, in the shape of an 80's videogame style animation, so the site's visitors could not only read the race results, but they could see it in a moving animation! WOW! Impressive!

They provided me a CSV file with all the races details: start and arrival order, horse names, driver names, prizes, etc. My Flash app read that file for each race and displayed the above said animation.

Nowadays the Flash support is significantly declined, so we must revert to ascii-art!

Task

Your task is to create a full program or function that reads the race data in CSV format from standard input and outputs an ascii-art representation of the race as shown in the example below.

INPUT

CSV data with 2 fields: 1) start order; 2) arrival time at the Finish in the format 1.13.4 (1 minute, 13 seconds, 4 tenths of second). If the time reports R means that the horse is Retreated (didn't finish the race) due to incident, fall or other reason. Note: The arrival time could be the same for 2 or more horses, in this case they share the arrival position.

```<code>1,1.13.4
2,1.13.0
3,R
4,1.12.7
5,1.11.5
6,1.13.4
7,1.12.1
8,1.17.9
</code>```

OUTPUT

For each CSV row, output a racetrack like this:

```<code>1_|______________4(1.13.0)___________________________
</code>```

The racetrack is composed by:

1 which is the horses start order.

_| where _ is a spacer and the | is the finish line.

50 x _ that represents 50 tenths of second.

5(1.13.4) that is the arrival position followed by the arrival time. This must be positioned respecting the time differences between horses. For example: you position the 1st arrived on the Finish line at time 1.11.5, the second arrives at time 1.12.1, the difference is 1.12.1 - 1.11.5 = 6 tenths of second, so the second horse should be positioned at the 6th character, and so on. If the time difference is more than 50 tenths of seconds (or 5 seconds) you must position the horse at the end. The same if the horse is R (Retreated).

So the whole racetrack for the CSV data above should be:

```<code>  F=Finish line
1_|____________________________5(1.13.4)_____________
2_|______________4(1.13.0)___________________________
3_|__________________________________________________R
4_|___________3(1.12.7)______________________________
5_1(1.11.5)__________________________________________
6_|____________________________5(1.13.4)_____________
7_|_____2(1.12.1)____________________________________
8_|__________________________________________________6(1.17.9)
  012345678901234567890123456789012345678901234567890
</code>```

There is no need to add F=Finish line, and the last line 0123456789... that is only for explaining purpose.

Test cases

```<code>RACE:
1,1.14.9
2,R
3,R
4,1.14.2
5,1.15.2
6,1.15.3
7,1.15.3

RACE:
1,1.13.6
2,1.13.8
3,R,
4,1.15.9
5,1.13.8
6,R,
7,1.14.4
8,1.15.6
9,1.14.1
10,1.13.9
11,1.13.2
12,1.14.3
13,1.15.0

RACE:
1,1.13.4
2,1.13.0
3,R
4,1.12.7
5,1.11.5
6,1.13.4
7,1.12.1
8,1.17.9

RACE:
1,1.17.3
2,1.20.4
3,1.17.0
4,1.18.8
5,1.18.5
6,1.18.4
7,1.18.4
8,1.17.8
9,1.18.3
10,1.18.7
11,R

RACE:
1,1.17.5
2,R
3,1.17.7
4,1.16.9
5,1.16.1
6,1.18.9

RACE:
1,1.12.8
2,1.13.0
3,1.13.2
4,1.12.7
5,1.11.5
6,1.13.0
7,1.12.1
8,1.12.8
</code>```

Rules

Shortest code wins.

答:
Python 2, <s>282</s> <s>272</s> 246 bytes

Similar to Arnauld the input is assumed to be already stripped from the starting number since it is implicit.

H=input().split("\n")
T=[float(c[2:])if c[2:]else 99for c in H]
P=[min(int(10*(t-min(T))),50)for t in T]
S=sorted(list(set(T)))
i=0
u="_"
for h,p,t in zip(H,P,T):i+=1;s=S.index(t)+1;print`i`+u+"|"*(s>1)+u*p+[h,"%d(%s)"%(s,h)][t<99]+u*(41-p+(s<2))
```

Title: A day at the Horse Races


ContentLicense: CC BY-SA 3.0

Title: A day at the Horse Races

Body:
Background

Back in the late 90's / first 00's when Flash Web Design was so much cool that noone could live without having a full Flash website, or at least an animated widget, I was hired to develop a "horse races viewer" in Flash/Actionscript, in the shape of an 80's videogame style animation, so the site's visitors could not only read the race results, but they could see it in a moving animation! WOW! Impressive!

They provided me a CSV file with all the races details: start and arrival order, horse names, driver names, prizes, etc. My Flash app read that file for each race and displayed the above said animation.

Nowadays the Flash support is significantly declined, so we must revert to ascii-art!

Task

Your task is to create a full program or function that reads the race data in CSV format from standard input and outputs an ascii-art representation of the race as shown in the example below.

INPUT

CSV data with 2 fields: 1) start order; 2) arrival time at the Finish in the format 1.13.4 (1 minute, 13 seconds, 4 tenths of second). If the time reports R means that the horse is Retreated (didn't finish the race) due to incident, fall or other reason. Note: The arrival time could be the same for 2 or more horses, in this case they share the arrival position.

```<code>1,1.13.4
2,1.13.0
3,R
4,1.12.7
5,1.11.5
6,1.13.4
7,1.12.1
8,1.17.9
</code>```

OUTPUT

For each CSV row, output a racetrack like this:

```<code>1_|______________4(1.13.0)___________________________
</code>```

The racetrack is composed by:

1 which is the horses start order.

_| where _ is a spacer and the | is the finish line.

50 x _ that represents 50 tenths of second.

5(1.13.4) that is the arrival position followed by the arrival time. This must be positioned respecting the time differences between horses. For example: you position the 1st arrived on the Finish line at time 1.11.5, the second arrives at time 1.12.1, the difference is 1.12.1 - 1.11.5 = 6 tenths of second, so the second horse should be positioned at the 6th character, and so on. If the time difference is more than 50 tenths of seconds (or 5 seconds) you must position the horse at the end. The same if the horse is R (Retreated).

So the whole racetrack for the CSV data above should be:

```<code>  F=Finish line
1_|____________________________5(1.13.4)_____________
2_|______________4(1.13.0)___________________________
3_|__________________________________________________R
4_|___________3(1.12.7)______________________________
5_1(1.11.5)__________________________________________
6_|____________________________5(1.13.4)_____________
7_|_____2(1.12.1)____________________________________
8_|__________________________________________________6(1.17.9)
  012345678901234567890123456789012345678901234567890
</code>```

There is no need to add F=Finish line, and the last line 0123456789... that is only for explaining purpose.

Test cases

```<code>RACE:
1,1.14.9
2,R
3,R
4,1.14.2
5,1.15.2
6,1.15.3
7,1.15.3

RACE:
1,1.13.6
2,1.13.8
3,R,
4,1.15.9
5,1.13.8
6,R,
7,1.14.4
8,1.15.6
9,1.14.1
10,1.13.9
11,1.13.2
12,1.14.3
13,1.15.0

RACE:
1,1.13.4
2,1.13.0
3,R
4,1.12.7
5,1.11.5
6,1.13.4
7,1.12.1
8,1.17.9

RACE:
1,1.17.3
2,1.20.4
3,1.17.0
4,1.18.8
5,1.18.5
6,1.18.4
7,1.18.4
8,1.17.8
9,1.18.3
10,1.18.7
11,R

RACE:
1,1.17.5
2,R
3,1.17.7
4,1.16.9
5,1.16.1
6,1.18.9

RACE:
1,1.12.8
2,1.13.0
3,1.13.2
4,1.12.7
5,1.11.5
6,1.13.0
7,1.12.1
8,1.12.8
</code>```

Rules

Shortest code wins.

Body:
JavaScript (ES6), 261 bytes

Takes an array of time strings "1.ss.t" as input. The start order is implicit.

a=>a.map((t,i)=>(u='_',++i>9?'':' ')+i+u+u.repeat(x=(x=t>'9'?50:t.slice(2)*10-s[0].slice(2)*10)>50?50:x,p=s.indexOf(t)+1+`(${t})`).replace(u,'|')+(x<50?p:'')+u.repeat((x=50-p.length-x)>0?x:0)+(x>0?'':t>'9'?t:p),s=a.filter((v,i)=>a.indexOf(v)==i).sort()).join`
`

Demo

let f =

a=>a.map((t,i)=>(u='_',++i>9?'':' ')+i+u+u.repeat(x=(x=t>'9'?50:t.slice(2)*10-s[0].slice(2)*10)>50?50:x,p=s.indexOf(t)+1+`(${t})`).replace(u,'|')+(x<50?p:'')+u.repeat((x=50-p.length-x)>0?x:0)+(x>0?'':t>'9'?t:p),s=a.filter((v,i)=>a.indexOf(v)==i).sort()).join`
`

console.log(f([
  "1.13.4",
  "1.13.0",
  "R",
  "1.12.7",
  "1.11.5",
  "1.13.4",
  "1.12.1",
  "1.17.9"
]));

console.log(f([
  "1.13.6",
  "1.13.8",
  "R",
  "1.15.9",
  "1.13.8",
  "R",
  "1.14.4",
  "1.15.6",
  "1.14.1",
  "1.13.9",
  "1.13.2",
  "1.14.3",
  "1.15.0"
]));


问:
Binary Countdown Length
inspired by Count down from infinity

Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0:

Convert N to binary (4812390 -> 10010010110111001100110)

Flip each bit (10010010110111001100110 -> 01101101001000110011001)

Trim leading zeroes (01101101001000110011001 -> 1101101001000110011001)

Convert back to decimal (1101101001000110011001 -> 3576217)

Rules

Input and output may be in any unambiguous, consistent format

The input will be within the native representable integer range for your language (if your language supports arbitrarily-large integers, there is no bound)

Test Cases

```<code>0 -> 0
1 -> 1
42 -> 6
97 -> 3
170 -> 8
255 -> 1
682 -> 10
8675309 -> 11
4812390 -> 14
178956970 -> 28
2863311530 -> 32
</code>```

This sequence is A005811 in the OEIS.

答:
Octave, 47 bytes

```<code>@(x)(sum(dec2bin(bitxor(x,idivide(x,2)))=='1'))
</code>```

According to the OEIS entry, the value we are looking for as the solution to this challenge is also equal to the number of 1s in the Gray code for the given integer.

Wikipedia tells me the Gray code can be calculated as x ^ (x >> 1), so in the above function I calculate the Gray code as such, convert it to a binary string, and count how many digits of that string are 1.

Title: Binary Countdown Length

Body:
Octave, 47 bytes

@(x)(sum(dec2bin(bitxor(x,idivide(x,2)))=='1'))

According to the OEIS entry, the value we are looking for as the solution to this challenge is also equal to the number of 1s in the Gray code for the given integer.

Wikipedia tells me the Gray code can be calculated as x ^ (x >> 1), so in the above function I calculate the Gray code as such, convert it to a binary string, and count how many digits of that string are 1.


问:
Trick or Treat polyglot
Since Halloween is coming up I thought I might start a fun little code golf challenge!

The challenge is quite simple. You have to write a program that outputs either trick or treat.

"The twist?" you may ask. Well let me explain:

Your program has to do the following:

Be compilable/runnable in two different languages. Different versions of the same language don't count.

When you run the program in one language it should output trick and the other should output treat. The case is irrelevant and padding the string with whitespace characters are allowed (see examples).

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

A few explanations:

Valid outputs (Just for the words not for running the code in the two languages. Also adding quotes to signalize the beginning or end of the output. Do not include them in your solution!):

```<code>"trick"

"Treat"

"    TReAt"

"
     tRICk          "
</code>```

Invalid outputs:

```<code>"tri ck"

"tr
eat"

"trck"
</code>```

I'm interested to see what you can come up with! Happy Golfing!

I'd like to note that this is my first challenge so if you have suggestions on this question please leave them in the form of a comment.

Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

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 leaderboard snippet:

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

var QUESTION_ID=97472,OVERRIDE_USER=23417;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i,TAGS_REG = /(<([^>]+)>)/ig;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:400px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
Haskell / Ruby, 74 bytes

```<code>--0;True=false
main=if True then print "trick" else print "treat";--0;end
</code>```

Haskell

Anything starting with -- is treated as a comment. Actual program in Haskell is now just

```<code>main=if True then print "trick" else print "treat";
</code>```

which prints "trick".

Ruby

--0 is just -(-0). So the first line declares a constant True with a value false.
Next line does the actual printing and since True is false, it prints "treat". main is just treated as a variable in ruby and is assigned the value 0.

Title: Trick or Treat polyglot

Body:
Haskell / Ruby, 74 bytes

--0;True=false
main=if True then print "trick" else print "treat";--0;end

Haskell

Anything starting with -- is treated as a comment. Actual program in Haskell is now just

main=if True then print "trick" else print "treat";

which prints "trick".

Ruby

--0 is just -(-0). So the first line declares a constant True with a value false.
Next line does the actual printing and since True is false, it prints "treat". main is just treated as a variable in ruby and is assigned the value 0.


Title: Bailey–Borwein–Plouffe Iterations

Body:
Bailey–Borwein–Plouffe Iterations

We've seen a few pi challenges on PPCG, but none that specifically dictate the algorithm you should be using. I'd like to see implementations of the Bailey–Borwein–Plouffe algorithm in any language up to iteration n. The formula is as follows:

Your algorithm should output each iteration up to n, showing intermediate sums as well as the final result to form a "piangle". You may also use the reduced polynomial form of the algorithm shown on the wikipedia page. An example run for n=50 is shown below:

```<code>3
3.1
3.14
3.141
3.1415
3.14159
3.141592
3.1415926
3.14159265
3.141592653
3.1415926535
3.14159265358
3.141592653589
3.1415926535897
3.14159265358979
3.141592653589793
3.1415926535897932
3.14159265358979323
3.141592653589793238
3.1415926535897932384
3.14159265358979323846
3.141592653589793238462
3.1415926535897932384626
3.14159265358979323846264
3.141592653589793238462643
3.1415926535897932384626433
3.14159265358979323846264338
3.141592653589793238462643383
3.1415926535897932384626433832
3.14159265358979323846264338327
3.141592653589793238462643383279
3.1415926535897932384626433832795
3.14159265358979323846264338327950
3.141592653589793238462643383279502
3.1415926535897932384626433832795028
3.14159265358979323846264338327950288
3.141592653589793238462643383279502884
3.1415926535897932384626433832795028841
3.14159265358979323846264338327950288419
3.141592653589793238462643383279502884197
3.1415926535897932384626433832795028841971
3.14159265358979323846264338327950288419716
3.141592653589793238462643383279502884197169
3.1415926535897932384626433832795028841971693
3.14159265358979323846264338327950288419716939
3.141592653589793238462643383279502884197169399
3.1415926535897932384626433832795028841971693993
3.14159265358979323846264338327950288419716939937
3.141592653589793238462643383279502884197169399375
3.1415926535897932384626433832795028841971693993751
3.14159265358979323846264338327950288419716939937510
</code>```

The precision of each iteration should equal the n that is passed to the algorithm, that is to say that each iteration should calculate pi up to the passed n for all k.

Rules:

Built-ins are not allowed, nor is pi, you must use the formula.

You must support n up to a maximum that your language allows in terms of the calculation of 16^n. If the input is causing an arithmetic overflow during calculation after x<n executions because your language only supports decimals up to 2^32-1, this is fine. Any other assumptions on n are not fine.

You MUST provide an explanation of how you got the output if it is not obvious. For instance, if you're posting in a Golfing language a break-down is 100% required. This is to ensure you're using the algorithm that is specified.

Standard loop-holes are disallowed.

This is code-golf, lowest byte count wins here.

Reference Code (Code used to Generate Example):

```<code>public static void main(String[] args) {
    (0..50).each {
        n->
        def x=(0..n).collect {
            j->
            def k=new BigDecimal(j)
            def s={it.setScale(n)}
            def a=s(1.0g).divide(s(16.0g)**s(k))
            def b=s(4.0g)/(s(8.0g)*s(k)+s(1.0g))
            def c=s(2.0g)/(s(8.0g)*s(k)+s(4.0g))
            def d=s(1.0g)/(s(8.0g)*s(k)+s(5.0g))
            def e=s(1.0g)/(s(8.0g)*s(k)+s(6.0g))
            def f=a*(b-c-d-e)
        }.sum()
        println(n + "\t" + x.setScale(n, BigDecimal.ROUND_DOWN))
    }
}
</code>```

This implementation caps out at n=255, you may cap out at less or more.

This implementation was done in Groovy.

Body:
PARI/GP, 86 bytes

n->for(k=p=0,n,printf("%."k"f\n",(p=16*p-4/(3-j=8*k+4)-2/j-1/j++-1/j++)\(8/5)^k/10^k))

Or without the decimal point in 69 bytes:

n->for(k=p=0,n,print((p=16*p-4/(3-j=8*k+4)-2/j-1/j++-1/j++)\(8/5)^k))

Rather than dividing through by 16k each iteration, the previous value of p is instead multiplied by 16. Floor of p ÷ (8/5)k is then the value of π truncated to the correct number of digits.

Sample Usage

$ gp
? n->for(k=p=0,n,printf("%."k"f\n",(p=16*p-4/(3-j=8*k+4)-2/j-1/j++-1/j++)\(8/5)^k/10^k))
? %(20)
3
3.1
3.14
3.141
3.1415
3.14159
3.141592
3.1415926
3.14159265
3.141592653
3.1415926535
3.14159265358
3.141592653589
3.1415926535897
3.14159265358979
3.141592653589793
3.1415926535897932
3.14159265358979323
3.141592653589793238
3.1415926535897932384
3.14159265358979323846


问:
Count without 3

Background

When I was in elementary school, we used to play a game in math class that goes as follows.

All kids sit in a big circle and take turns counting, starting from 1.

However, the following numbers must be skipped while counting:

Numbers that are multiples of 3.

Numbers that have a 3 in its decimal representation.

The first 15 numbers the kids should say are

```<code>1 2 4 5 7 8 10 11 14 16 17 19 20 22 25
</code>```

Whenever somebody gets a number wrong – says a number that isn't in the sequence or skips a number that is – he's removed from the circle. This goes on until there's only one kid left.

Task

You're bad at this game, so you decide to cheat. Write a program or a function that, given a number of the sequence, calculates the next number of the sequence.

You don't have to handle numbers that cannot be represented using your language's native numeric type, provided that your program works correctly up to input 251 and that your algorithm works for arbitrarily large inputs.

Input and output can use any convenient base.

Since you have to conceal your code, it must be as short as possible. In fact, this is code-golf, so the shortest code in bytes wins.

Test cases

```<code>  1 ->   2
  2 ->   4
 11 ->  14
 22 ->  25
 29 ->  40
251 -> 254
</code>```

答:
PHP, <s>60</s> <s>55</s> <s>54</s> 46 bytes

Thanks to @user59178 for shaving off a few bytes, @AlexHowansky for a byte, @Titus for another few bytes

```<code>for(;strstr($i=++$argv[1],51)|$i%3<1;);echo$i;
</code>```

Called from command line with -r. Naive method that loops while the number is a multiple of 3, or has 3 in its digits.

Title: Count without 3

Body:
PHP, <s>60</s> <s>55</s> <s>54</s> 46 bytes

Thanks to @user59178 for shaving off a few bytes, @AlexHowansky for a byte, @Titus for another few bytes

for(;strstr($i=++$argv[1],51)|$i%3<1;);echo$i;

Called from command line with -r. Naive method that loops while the number is a multiple of 3, or has 3 in its digits.


问:
Depalindromize this string!
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

Remember, this is code-golf, so the code with the fewest bytes wins.

答:
Perl, 23 + 2 (-pl flag) = <s>28</s> 25 bytes

```<code>perl -ple '$_=substr$_,0,1+y///c/2'
</code>```

Ungolfed:

while (<>) {             # -p flag
    chomp($_)            # -l flag
    $_ = substr($_, 0, 1 + length($_) / 2);
    print($_, "\n")      # -pl flag
}
```

Thanx to @ardnew.

Title: Depalindromize this string!

Body:
Perl, 23 + 2 (-pl flag) = <s>28</s> 25 bytes

perl -ple '$_=substr$_,0,1+y///c/2'

Ungolfed:

while (<>) {             # -p flag
    chomp($_)            # -l flag
    $_ = substr($_, 0, 1 + length($_) / 2);
    print($_, "\n")      # -pl flag
}

Thanx to @ardnew.


答:
Vim, <s>62</s> 59 bytes

-3 bytes thanks to DJMcMayhem

C0
<C-r>=pri<Tab>'%b',<C-r>")
<Esc>0qqC<C-r>=tr(@",'01','10')
<Esc>:s/^0\+
k<C-a>j@qq@q
```

<p>Here is the xxd output with the unprintable characters intact:</p>

<pre class="lang-none prettyprint-override"><code>0000000: 4330 0d12 3d70 7269 0927 2562 272c 1222  C0..=pri.'%b',."
0000010: 290d 1b30 7171 4312 3d74 7228 4022 2c27  )..0qqC.=tr(@",'
0000020: 3031 272c 2731 3027 290d 1b3a 732f 5e30  01','10')..:s/^0
0000030: 5c2b 0d6b 016a 4071 7140 71              \+.k.j@qq@q
</code>```

Try it online!

Explanation

C                                   " Delete the number (it goes in @")
0<CR>                               " Print 0 (our counter) and a carriage return
<C-r>=pri<Tab>'%b',<C-r>")<CR><Esc> " Use `printf()` to insert the number as base 2
0qq                                 " Return to column 0, start recording a macro
  C<C-r>=tr(@",'01','10')<CR><Esc>  "   Replace 0s with 1s and vice versa
  :s/^0\+<CR>                       "   Delete leading 0s
  k<C-a>                            "   Increment the number on the line above
  j                                 "   Return to the previous line
  @q                                "   Invoke macro recursively
q@q                                 " Stop recording and invoke macro
```

Title: Binary Countdown Length

Body:
inspired by Count down from infinity

Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0:

Convert N to binary (4812390 -> 10010010110111001100110)

Flip each bit (10010010110111001100110 -> 01101101001000110011001)

Trim leading zeroes (01101101001000110011001 -> 1101101001000110011001)

Convert back to decimal (1101101001000110011001 -> 3576217)

Rules

Input and output may be in any unambiguous, consistent format

The input will be within the native representable integer range for your language (if your language supports arbitrarily-large integers, there is no bound)

Test Cases

```<code>0 -> 0
1 -> 1
42 -> 6
97 -> 3
170 -> 8
255 -> 1
682 -> 10
8675309 -> 11
4812390 -> 14
178956970 -> 28
2863311530 -> 32
</code>```

This sequence is A005811 in the OEIS.

Body:
Vim, <s>62</s> 59 bytes

-3 bytes thanks to DJMcMayhem

C0
<C-r>=pri<Tab>'%b',<C-r>")
<Esc>0qqC<C-r>=tr(@",'01','10')
<Esc>:s/^0\+
k<C-a>j@qq@q

Here is the xxd output with the unprintable characters intact:

0000000: 4330 0d12 3d70 7269 0927 2562 272c 1222  C0..=pri.'%b',."
0000010: 290d 1b30 7171 4312 3d74 7228 4022 2c27  )..0qqC.=tr(@",'
0000020: 3031 272c 2731 3027 290d 1b3a 732f 5e30  01','10')..:s/^0
0000030: 5c2b 0d6b 016a 4071 7140 71              \+.k.j@qq@q

Try it online!

Explanation

C                                   " Delete the number (it goes in @")
0<CR>                               " Print 0 (our counter) and a carriage return
<C-r>=pri<Tab>'%b',<C-r>")<CR><Esc> " Use `printf()` to insert the number as base 2
0qq                                 " Return to column 0, start recording a macro
  C<C-r>=tr(@",'01','10')<CR><Esc>  "   Replace 0s with 1s and vice versa
  :s/^0\+<CR>                       "   Delete leading 0s
  k<C-a>                            "   Increment the number on the line above
  j                                 "   Return to the previous line
  @q                                "   Invoke macro recursively
q@q                                 " Stop recording and invoke macro


问:
Square-unspiral the string!
Given a string, first square it as follows:

First, write the string.

```<code>abcde
</code>```

Next, write the string rotated one left.

```<code>abcde
bcdea
</code>```

Keep doing this until you have written len(string) lines.

```<code>abcde
bcdea
cdeab
deabc
eabcd
</code>```

Now, read from the string like this:

```<code>----+
+--+|
|+>||
|+-+|
+---+
</code>```

Which gives:

```<code>abcdeabcdcbaedcbcdeabaede
</code>```

Print this string.

Test cases

```<code>abcdef -> abcdefabcdedcbafedcbcdefabcbafedefaf
cena! -> cena!cenanec!anena!cec!a!
ppcg -> ppcgppcppgcpcgpg
abc -> abcabacbc
ab -> abab
a -> a
 ->
</code>```

Please comment if a test case is incorrect.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

答:
MATL, 27 bytes

```<code>"GX@q_YS]vGn1YL_GnoQ&Ple&S)
</code>```

The empty input exits with an error (producing the correct output).

Try it online! Or verify all test cases.

Title: Square-unspiral the string!

Body:
MATL, 27 bytes

"GX@q_YS]vGn1YL_GnoQ&Ple&S)

The empty input exits with an error (producing the correct output).

Try it online! Or verify all test cases.


答:
Ruby, 47 bytes

```<code>i=gets.to_i;i while(i+=1)%3==0||"#{i}"=~/3/;p i
</code>```

I really feel like this can be golfed further.

Title: Count without 3

Body:
Background

When I was in elementary school, we used to play a game in math class that goes as follows.

All kids sit in a big circle and take turns counting, starting from 1.

However, the following numbers must be skipped while counting:

Numbers that are multiples of 3.

Numbers that have a 3 in its decimal representation.

The first 15 numbers the kids should say are

```<code>1 2 4 5 7 8 10 11 14 16 17 19 20 22 25
</code>```

Whenever somebody gets a number wrong – says a number that isn't in the sequence or skips a number that is – he's removed from the circle. This goes on until there's only one kid left.

Task

You're bad at this game, so you decide to cheat. Write a program or a function that, given a number of the sequence, calculates the next number of the sequence.

You don't have to handle numbers that cannot be represented using your language's native numeric type, provided that your program works correctly up to input 251 and that your algorithm works for arbitrarily large inputs.

Input and output can use any convenient base.

Since you have to conceal your code, it must be as short as possible. In fact, this is code-golf, so the shortest code in bytes wins.

Test cases

```<code>  1 ->   2
  2 ->   4
 11 ->  14
 22 ->  25
 29 ->  40
251 -> 254
</code>```

Body:
Ruby, 47 bytes

i=gets.to_i;i while(i+=1)%3==0||"#{i}"=~/3/;p i

I really feel like this can be golfed further.


答:
C#, <s>56</s>, 51 bytes.

This is surprisingly short for a C# answer!

```<code>x=>{while(++x%3<1|(x+"").Contains("3"));return x;};
</code>```

Title: Count without 3

Body:
C#, <s>56</s>, 51 bytes.

This is surprisingly short for a C# answer!

x=>{while(++x%3<1|(x+"").Contains("3"));return x;};


答:
Labyrinth, 104 103 bytes

```<code>'  )25 }_';:_';_2/;{
''', 6 2 1   1   { (
 ' | / _ _   _}*2_ $
 * _ :!\ }2_\     !:
 652       @'''''''
</code>```

Try it Online!

Explanation:

The instruction pointer starts at the top-left most non-wall character (walls include spaces and any letter except v).

Orange:

This loop gets the input one character at a time as an ASCII code, adding it to the current value and multiplying the current value by 256.

' No-op

, Push the ascii code of the next input char to the top of the stack or -1 if EOF. At this point if input was received, the code will turn right (moving down) because the top of the stack is potive. Otherwise it will turn left because the top of the stack is negative.

| Pop the top two items from the stack and push the result of a bitwise OR.

_ Push zero

256 Each digit seen pops x and pushes x*10+digit. So this combined with the push zero previous push 256 to the top of the stack.

* Pop y, pop x, push x*y. At this point since the top of the stack is positive the code will turn right to continue around the loop.

Blue:

) Increment the top of the stack. When the end of input is reached, the code will turn left to get to this point with a -1 on the stack which will get incremented to zero.

256 Having the top of the stack 0 allows us to push this 256.

/ Pop y, pop x push x/y (integer division). Since we were multiplying the input by 256 each loop, we need to revert the last multiplication.

: Duplicate the top of the stack so we have a copy of the current value for later.

! Pop the top of the stack and print the integer value to STDOUT.

\ Print a new line.

_2 Push a two to the top of the stack.

} Move the top of the stack to the top of the auxiliary stack.

Red:

This loop flips the bits of the current value by XOR with a particular value calculated in the inner (green) loop. It then outputs the current value and exits the program if the current value is zero.

_ Push zero (control flow).

; Discard the top of the stack (control flow).

: Duplicate the current value. The copy will be used to calculate the XOR.

_ Push zero (control flow).

(Green loop)

$ Pop y, pop x, Push x XOR y.

:! Duplicate the current value and print the integer representation.

If the current value is 0, we continue straight into the @ and terminate.

\ Print a new line.

_2} Push 2 and move to the aux stack.

_1 Push 1 (control flow).

Green:

This loop calculates the value by which we need to XOR the current value. This is done by repeatedly doubling the top of the auxiliary stack while halving a copy of the current value on the stop of the main stack until it reaches 0.

_ Push zero (control flow).

; Discard the current value which is only used to enforce control flow.

_2 Push 2 in order to halve the current value.

/ Divide

{ Move the top of the aux stack to the top of the main stack.

_2* Double the top of the stack

} Move the top of the main stack back to the aux stack.

_1 Push one for control flow.

After exiting the loop:

; Discard the left over zero from calculating the XOR.

{ Move the calculated XOR to the main stack.

( Subtract one from XOR value.

ContentLicense: CC BY-SA 4.0

Title: Count down from "Infinity"

Body:
Seems like an impossible task right? Well, it's actually not that hard. If we write the word Infinity as 8-bit binary ASCII code, we'll get:

```<code>01001001 01101110 01100110 01101001 01101110 01101001 01110100 01111001
</code>```

This can be concatenated, and converted to the decimal value 5291279215216915577. Now that's a number we can work with...

The way you'll count down is:

Output the original string as a decimal number (as shown above)

Remove leading 0s in its binary representation (if any)

Toggle the bits in the binary representation (1->0, 0->1)

Output the number in decimal

Repeat steps 2-4 as until you reach 0.

Challenge:

Create a program or function that takes a string as input, and outputs (on any suitable format) the numbers you'll get when performing the procedure above.

Test case:

I think the challenge will be fairly easy to understand, even though it's only one test case. I'll use Inf instead of Infinity to keep this fairly short.

```<code>Inf
4812390  (10010010110111001100110)
3576217  ( 1101101001000110011001)
618086   (   10010110111001100110)
430489   (    1101001000110011001)
93798    (      10110111001100110)
37273    (       1001000110011001)
28262    (        110111001100110)
4505     (          1000110011001)
3686     (           111001100110)
409      (              110011001)
102      (                1100110)
25       (                  11001)
6        (                    110)
1        (                      1)
0        (                      0)
</code>```

```<code>Input: Inf
Output:
4812390, 3576217, 618086, 430489, 93798, 37273, 28262, 4505, 3686, 409, 102, 25, 6, 1, 0
</code>```

```<code>Input: Infinity
Output:
5291279215216915577, 3932092821637860230, 679593196789527673, 473328307817319302, 103132444486104185, 40982743589751686, 31074850448176249, 4953946570787718, 4053252683953273, 450346943417222, 112603010004089, 28134478351238, 7049893737593, 1746199284614, 452823970937, 96931842950, 40507110521, 28212366214, 6147372153, 2442562438, 1852404857, 295078790, 241792121, 26643334, 6911097, 1477510, 619641, 428934, 95353, 35718, 29817, 2950, 1145, 902, 121, 6, 1, 0
</code>```

Your code must support strings that can be represented as a binary number up to the limit of your language. All strings will only contain printable ASCII-characters from 32-126 (space to tilde).

Leaderboard

var QUESTION_ID=98274,OVERRIDE_USER=31516;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Labyrinth, 104 103 bytes

'  )25 }_';:_';_2/;{
''', 6 2 1   1   { (
 ' | / _ _   _}*2_ $
 * _ :!\ }2_\     !:
 652       @'''''''

Try it Online!

Explanation:

The instruction pointer starts at the top-left most non-wall character (walls include spaces and any letter except v).

Orange:

This loop gets the input one character at a time as an ASCII code, adding it to the current value and multiplying the current value by 256.

' No-op

, Push the ascii code of the next input char to the top of the stack or -1 if EOF. At this point if input was received, the code will turn right (moving down) because the top of the stack is potive. Otherwise it will turn left because the top of the stack is negative.

| Pop the top two items from the stack and push the result of a bitwise OR.

_ Push zero

256 Each digit seen pops x and pushes x*10+digit. So this combined with the push zero previous push 256 to the top of the stack.

* Pop y, pop x, push x*y. At this point since the top of the stack is positive the code will turn right to continue around the loop.

Blue:

) Increment the top of the stack. When the end of input is reached, the code will turn left to get to this point with a -1 on the stack which will get incremented to zero.

256 Having the top of the stack 0 allows us to push this 256.

/ Pop y, pop x push x/y (integer division). Since we were multiplying the input by 256 each loop, we need to revert the last multiplication.

: Duplicate the top of the stack so we have a copy of the current value for later.

! Pop the top of the stack and print the integer value to STDOUT.

\ Print a new line.

_2 Push a two to the top of the stack.

} Move the top of the stack to the top of the auxiliary stack.

Red:

This loop flips the bits of the current value by XOR with a particular value calculated in the inner (green) loop. It then outputs the current value and exits the program if the current value is zero.

_ Push zero (control flow).

; Discard the top of the stack (control flow).

: Duplicate the current value. The copy will be used to calculate the XOR.

_ Push zero (control flow).

(Green loop)

$ Pop y, pop x, Push x XOR y.

:! Duplicate the current value and print the integer representation.

If the current value is 0, we continue straight into the @ and terminate.

\ Print a new line.

_2} Push 2 and move to the aux stack.

_1 Push 1 (control flow).

Green:

This loop calculates the value by which we need to XOR the current value. This is done by repeatedly doubling the top of the auxiliary stack while halving a copy of the current value on the stop of the main stack until it reaches 0.

_ Push zero (control flow).

; Discard the current value which is only used to enforce control flow.

_2 Push 2 in order to halve the current value.

/ Divide

{ Move the top of the aux stack to the top of the main stack.

_2* Double the top of the stack

} Move the top of the main stack back to the aux stack.

_1 Push one for control flow.

After exiting the loop:

; Discard the left over zero from calculating the XOR.

{ Move the calculated XOR to the main stack.

( Subtract one from XOR value.


问:
Interlace strings
Your challenge is to write a program or function that, when given two strings of equal length, swaps every other character and outputs/returns the resulting strings in either order.

Examples

```<code>"Hello," "world!" --> "Hollo!" "werld,"
"code" "golf" --> "codf" "gole"
"happy" "angry" --> "hnpry" "aagpy"
"qwerty" "dvorak" --> "qvertk" "dworay"
"1, 2, 3" "a, b, c" --> "1, b, 3" "a, 2, c"
"3.141592653589" "2.718281828459" --> "3.111291623489" "2.748582858559"
"DJMcMayhem" "trichoplax" --> "DrMcMoylex" "tJichapham"
"Doorknob" "Downgoat" --> "Doonkoot" "Dowrgnab"
"Halloween" "Challenge" --> "Hhlloeegn" "Caallwnee"
</code>```

Rules

The strings will only contain ASCII chars (32-126).

The strings will always be the same length, and will never be empty.

You may accept input in any suitable format: separate parameters, items in an array, separated by one or more newlines, even concatenated. The only restriction is that one string must come fully before the other (e.g. a1\nb2\nc3 for "abc", "123" is invalid).

The output may be in either order (i.e. you can start swapping from the first or the second char), and in any valid format mentioned above. (2-item array, separated by newline(s), concatenated, etc.)

Scoring

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

答:
C, <s>54</s> 52 bytes

f(char*a,char*b,char*c){while(*c++=*a++,*c++=*b++);}
```
<p>Assumes output <code>c</code> has already the desired length.</p>
<p>Usage:</p>
<pre class="lang-c prettyprint-override"><code>main(){
 char a[]="123456";
 char b[]="abcdef";
 char c[sizeof(a)+sizeof(b)-1];
 f(a,b,c);
 puts(c);
</code>```

}

If you insist on creating the output, here is a 91 bytes solution:

char*g(char*a,char*b){char*c=malloc(2*strlen(a)),*d=c;while(*c++=*a++,*c++=*b++);return d;}
```
<p>Usage:</p>
<pre class="lang-c prettyprint-override"><code>main(){
 char a[]="123456";
 char b[]="abcdef";
 puts(g(a,b));
}
</code>```

Title: Interlace strings

Body:
C, <s>54</s> 52 bytes

f(char*a,char*b,char*c){while(*c++=*a++,*c++=*b++);}

Assumes output c has already the desired length.

Usage:

main(){
 char a[]="123456";
 char b[]="abcdef";
 char c[sizeof(a)+sizeof(b)-1];
 f(a,b,c);
 puts(c);

}

If you insist on creating the output, here is a 91 bytes solution:

char*g(char*a,char*b){char*c=malloc(2*strlen(a)),*d=c;while(*c++=*a++,*c++=*b++);return d;}

Usage:

main(){
 char a[]="123456";
 char b[]="abcdef";
 puts(g(a,b));
}


问:
How many integers contain a number in a specific range
The program should take input the number, the start of the range and the end of the range, and output how many integers the number appears between the start and end of the range, inclusive. Both programs and functions are allowed.

Example Inputs

For example:

```<code>//Input example 1
3,1,100
//Input example 2
3
1
100
//Input example 3
3 1 100
//Input example 4
a(3, 1, 100);
</code>```

All the above four input examples are valid and all of them mean that 3 is the number in question, 1 is the beginning of the range and 100 the the end of the range.

And then the program should output how many times 3 appears in the range from 1 to 100 inclusive. 3 appears in the integers 3, 13, 23, 30, 31, 32, 33, ..., 93 at a total of 19 times. So the program should output 19 as the output because that is how many times 3 appears in the range from 1 to 100.

Rules

Both programs and functions are allowed.

All numbers will be integers, meaning that there will not be any floats or doubles.

Note: the sought number will always be in the range 0≤x≤127. There will be no cases where it will be outside this 0≤x≤127 range.

As in the first example, with the case as 33, the number 3 will be counted as appearing only once, not twice.

The values of the start and end of the range will be between -65536 and 65535 inclusive.

The value of range's start will never exceed or equal to range's end. start < end

Also the range is inclusive. For example if the input was 8 8 10, the range would be 8≤x≤10 and hence the output will be 1.

Input can be taken in any of the ways shown in the examples. Input can be taken as a string or as a number, any way you wish.

Test Cases

```<code>3 1 100
19

3 3 93
19

12,-200,200
24          //This is because 12 appears in -129, -128, ..., -112, -12, 12, 112, 120, 121, 122, ...

123,1,3
0           //This is because all of 123's digits have to appear in the same order

3 33 34
2           //Because 3 appears in 2 numbers: 33 and 34

a(0,-1,1);
1

$ java NotVerbose 127 -12 27
0
</code>```

Snack Snippet

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 leaderboard snippet:

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

/* Configuration */

var QUESTION_ID = 98470; // 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 = 41805; // 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,]*[^\s,]),.*?(\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,
      });

  });

  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;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) 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}

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

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

table thead {
  font-weight: bold;
}

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

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
05AB1E, 6 bytes

Input in the form: upper bound, lower bound, number.

```<code>Ÿvy³åO
</code>```

Explanation:

```<code>Ÿ       # Inclusive range, [a, ..., b]
 vy     # For each element...
   ³å   # Check if the third input is a substring of the number
     O  # Sum up the results
</code>```

Uses the CP-1252 encoding. Try it online!

Body:
05AB1E, 6 bytes

Input in the form: upper bound, lower bound, number.

Ÿvy³åO

Explanation:

Ÿ       # Inclusive range, [a, ..., b]
 vy     # For each element...
   ³å   # Check if the third input is a substring of the number
     O  # Sum up the results

Uses the CP-1252 encoding. Try it online!


答:
Ruby, 26 bytes

```<code>f=->n{n<1?0:-n%4/2+f[n/2]}
</code>```

Inspired by xnor's Python answer.

Title: Binary Countdown Length

Body:
Ruby, 26 bytes

f=->n{n<1?0:-n%4/2+f[n/2]}

Inspired by xnor's Python answer.


答:
Perl, 20 bytes

Saved 2 bytes by using grep as in @ardnew's answer.

Bytecount includes 18 bytes of code and -ap flags.

$_=grep/@F/,<>..<>
```

<p>Give the 3 numbers on three separate lines :</p>

```perl -ape '$_=grep/@F/,<>..<>' <<< "3
1
100"
```

Title: How many integers contain a number in a specific range

Body:
The program should take input the number, the start of the range and the end of the range, and output how many integers the number appears between the start and end of the range, inclusive. Both programs and functions are allowed.

Example Inputs

For example:

```<code>//Input example 1
3,1,100
//Input example 2
3
1
100
//Input example 3
3 1 100
//Input example 4
a(3, 1, 100);
</code>```

All the above four input examples are valid and all of them mean that 3 is the number in question, 1 is the beginning of the range and 100 the the end of the range.

And then the program should output how many times 3 appears in the range from 1 to 100 inclusive. 3 appears in the integers 3, 13, 23, 30, 31, 32, 33, ..., 93 at a total of 19 times. So the program should output 19 as the output because that is how many times 3 appears in the range from 1 to 100.

Rules

Both programs and functions are allowed.

All numbers will be integers, meaning that there will not be any floats or doubles.

Note: the sought number will always be in the range 0≤x≤127. There will be no cases where it will be outside this 0≤x≤127 range.

As in the first example, with the case as 33, the number 3 will be counted as appearing only once, not twice.

The values of the start and end of the range will be between -65536 and 65535 inclusive.

The value of range's start will never exceed or equal to range's end. start < end

Also the range is inclusive. For example if the input was 8 8 10, the range would be 8≤x≤10 and hence the output will be 1.

Input can be taken in any of the ways shown in the examples. Input can be taken as a string or as a number, any way you wish.

Test Cases

```<code>3 1 100
19

3 3 93
19

12,-200,200
24          //This is because 12 appears in -129, -128, ..., -112, -12, 12, 112, 120, 121, 122, ...

123,1,3
0           //This is because all of 123's digits have to appear in the same order

3 33 34
2           //Because 3 appears in 2 numbers: 33 and 34

a(0,-1,1);
1

$ java NotVerbose 127 -12 27
0
</code>```

Snack Snippet

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 leaderboard snippet:

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

/* Configuration */

var QUESTION_ID = 98470; // 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 = 41805; // 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,]*[^\s,]),.*?(\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,
      });

  });

  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;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) 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}

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

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

table thead {
  font-weight: bold;
}

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

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Perl, 20 bytes

Saved 2 bytes by using grep as in @ardnew's answer.

Bytecount includes 18 bytes of code and -ap flags.

$_=grep/@F/,<>..<>

Give the 3 numbers on three separate lines :

perl -ape '$_=grep/@F/,<>..<>' <<< "3
1
100"


答:
Python 2, <s>47</s> 43 Bytes

Relatively straightforward, making use of Python 2's repr short-form.

f=lambda n,a,b:a<b and(`n`in`a`)+f(n,-~a,b)
```

<p>Ouput:</p>

<pre class="lang-python prettyprint-override"><code>f(  3,    1, 100) -> 19
f(  3,    3,  93) -> 19
f( 12, -200, 200) -> 24
f(123,    1,   3) -> 0
f(  3,   33,  34) -> 2
f(  0,   -1,   1) -> 1
f(127,   12,  27) -> 0
</code>```

Body:
Python 2, <s>47</s> 43 Bytes

Relatively straightforward, making use of Python 2's repr short-form.

f=lambda n,a,b:a<b and(`n`in`a`)+f(n,-~a,b)

Ouput:

f(  3,    1, 100) -> 19
f(  3,    3,  93) -> 19
f( 12, -200, 200) -> 24
f(123,    1,   3) -> 0
f(  3,   33,  34) -> 2
f(  0,   -1,   1) -> 1
f(127,   12,  27) -> 0


答:
JavaScript (ES6), <s>46</s> 45 bytes

```<code>f=(n,s,e)=>s<=e&&!!`${s++}`.match(n)+f(n,s,e)
</code>```

(My best nonrecursive version was 61 bytes.) Edit: Saved 1 byte thanks to @edc65.

Body:
JavaScript (ES6), <s>46</s> 45 bytes

f=(n,s,e)=>s<=e&&!!`${s++}`.match(n)+f(n,s,e)

(My best nonrecursive version was 61 bytes.) Edit: Saved 1 byte thanks to @edc65.


答:
JavaScript, <s>46</s> 45 bytes

```<code>f=(i,s,e)=>s>e?0:RegExp(i).test(s)+f(i,++s,e)
</code>```

Recursively count until start > end

Edit: Switch to RegExp test to save a byte

Body:
JavaScript, <s>46</s> 45 bytes

f=(i,s,e)=>s>e?0:RegExp(i).test(s)+f(i,++s,e)

Recursively count until start > end

Edit: Switch to RegExp test to save a byte


答:
PowerShell v2+, <s>64</s> <s>62</s> 56 bytes

```<code>param($c,$a,$b)$(for(;$a-le$b){1|?{$a++-match$c}}).count
</code>```

-6 bytes thanks to mazzy

Input via command-line arguments of the form number lower_bound upper_bound. A little goofy on the notation, because of the semicolons inside the for causing parse errors if it's not surrounded in $(...) to create a script block. We basically loop upward through $a until we hit $b, using Where-Object (the |?{...}) to pull out those numbers that regex -match against $c. That's encapsulated in parens, we take the .count thereof, and that's left on the pipeline and output is implicit.

If, however, we guarantee that the range will be no more than 50,000 elements, we can skip the loop and just use the range operator .. directly, for <s>45</s> 43 bytes. Since that's not in the challenge specifications, though, this isn't valid. Bummer.

```<code>param($c,$a,$b)($a..$b|?{$_-match$c}).count
</code>```

Body:
PowerShell v2+, <s>64</s> <s>62</s> 56 bytes

param($c,$a,$b)$(for(;$a-le$b){1|?{$a++-match$c}}).count

-6 bytes thanks to mazzy

Input via command-line arguments of the form number lower_bound upper_bound. A little goofy on the notation, because of the semicolons inside the for causing parse errors if it's not surrounded in $(...) to create a script block. We basically loop upward through $a until we hit $b, using Where-Object (the |?{...}) to pull out those numbers that regex -match against $c. That's encapsulated in parens, we take the .count thereof, and that's left on the pipeline and output is implicit.

If, however, we guarantee that the range will be no more than 50,000 elements, we can skip the loop and just use the range operator .. directly, for <s>45</s> 43 bytes. Since that's not in the challenge specifications, though, this isn't valid. Bummer.

param($c,$a,$b)($a..$b|?{$_-match$c}).count


答:
Vim, <s>46</s>, 41 bytes

```<code>C<C-r>=r<tab><C-r>")<cr><esc>jC0<esc>:g/<C-r>"/norm G<C-v><C-a>
kd{
</code>```

Input is in this format:

```<code>1, 100
3
</code>```

Body:
Vim, <s>46</s>, 41 bytes

C<C-r>=r<tab><C-r>")<cr><esc>jC0<esc>:g/<C-r>"/norm G<C-v><C-a>
kd{

Input is in this format:

1, 100
3


答:
Haskell, 65 bytes

```<code>import Data.List
(s#e)i=sum[1|x<-[s..e],isInfixOf(show i)$show x]
</code>```

The import ruins the score. Usage example: ((-200)#200)12 -> 24.

Body:
Haskell, 65 bytes

import Data.List
(s#e)i=sum[1|x<-[s..e],isInfixOf(show i)$show x]

The import ruins the score. Usage example: ((-200)#200)12 -> 24.


问:
Print/Output the L-phabet
Inspired by George Gibson's Print a Tabula Recta.

You are to print/output this exact text:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

(Yes, I typed that by hand)

You are allowed to use all lowercase instead of all uppercase.

However, your choice of case must be consistent throughout the whole text.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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 leaderboard snippet:

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

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 87064; // 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 = 48934; // 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,]*[^\s,]),.*?(\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,
      });

  });

  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;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) 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}

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

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

table thead {
  font-weight: bold;
}

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

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
QBIC, 42 bytes

```<code>[26|D=Z[26|c=b~a>b|c=a]D=D+chr$$(c+64)|]?D
</code>```

I should really make a CHR$ function in QBIC...

Output:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

Title: Print/Output the L-phabet

Body:
QBIC, 42 bytes

[26|D=Z[26|c=b~a>b|c=a]D=D+chr$$(c+64)|]?D

I should really make a CHR$ function in QBIC...

Output:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ


答:
MATL, 14 bytes

```<code>`Qtt3\wV51-hA~
</code>```

Try it online!

Explanation

```<code>`       % Do...while
  Q     %   Add 1. Takes input implicitly in the first iteration
  tt    %   Duplicate twice
  3\    %   Modulo 3
  wV    %   Swap, string representation
  51-   %   Subtract 51, which is ASCII for '3'
  h     %   Concatenate
  A~    %   True if any result was 0. That indicates that the number
        %   was a multiple of 3 or had some '3' digit; and thus a
        %   new iteration is needed
</code>```

Title: Count without 3

Body:
Background

When I was in elementary school, we used to play a game in math class that goes as follows.

All kids sit in a big circle and take turns counting, starting from 1.

However, the following numbers must be skipped while counting:

Numbers that are multiples of 3.

Numbers that have a 3 in its decimal representation.

The first 15 numbers the kids should say are

```<code>1 2 4 5 7 8 10 11 14 16 17 19 20 22 25
</code>```

Whenever somebody gets a number wrong – says a number that isn't in the sequence or skips a number that is – he's removed from the circle. This goes on until there's only one kid left.

Task

You're bad at this game, so you decide to cheat. Write a program or a function that, given a number of the sequence, calculates the next number of the sequence.

You don't have to handle numbers that cannot be represented using your language's native numeric type, provided that your program works correctly up to input 251 and that your algorithm works for arbitrarily large inputs.

Input and output can use any convenient base.

Since you have to conceal your code, it must be as short as possible. In fact, this is code-golf, so the shortest code in bytes wins.

Test cases

```<code>  1 ->   2
  2 ->   4
 11 ->  14
 22 ->  25
 29 ->  40
251 -> 254
</code>```

Body:
MATL, 14 bytes

`Qtt3\wV51-hA~

Try it online!

Explanation

`       % Do...while
  Q     %   Add 1. Takes input implicitly in the first iteration
  tt    %   Duplicate twice
  3\    %   Modulo 3
  wV    %   Swap, string representation
  51-   %   Subtract 51, which is ASCII for '3'
  h     %   Concatenate
  A~    %   True if any result was 0. That indicates that the number
        %   was a multiple of 3 or had some '3' digit; and thus a
        %   new iteration is needed


答:
Java, <s>92</s> <s>89</s> 71 bytes

Now with lambdas!

```<code>(t,l,u)->{int z=0;for(;l<=u;)if((l+++"").contains(t+""))z++;return z;};
</code>```

Old 89 byte function solution:

```<code>int d(int t,int l,int u){int a=0,i=l;for(;i<=u;)if((i+++"").contains(t+""))a++;return a;}
</code>```

Hooray for the super increment function!

Body:
Java, <s>92</s> <s>89</s> 71 bytes

Now with lambdas!

(t,l,u)->{int z=0;for(;l<=u;)if((l+++"").contains(t+""))z++;return z;};

Old 89 byte function solution:

int d(int t,int l,int u){int a=0,i=l;for(;i<=u;)if((i+++"").contains(t+""))a++;return a;}

Hooray for the super increment function!


答:
Java 7 85 bytes

int x(int a,int b,int c){int t=0;for(;b<=c;)if((b+++"").contains(a+""))t++;return t;}
```


答:
Commodore 64 195 bytes 182 bytes 135 bytes 126 bytes 123 122 tokenised BASIC bytes

Here is a version for the Commodore 64 (will also work with other Commodore BASIC most likely) - although the machine only displays 25 rows in BASIC by default, you can at least see the first row as BASIC is slow.

```<code> 0 x=0:fory=i+65to90:on-(i>0)and-(x=0)gosub1:printchr$(y);:next:print:i=i+1:on-(i<26)goto:end
 1 x=1:forz=1toi:printchr$(y);:next:return
</code>```

Written with CBM prg Studio. I'll see if I can work out a 6502 version at some point.

print 38911-(fre(0)-65536*(fre(0)<0)) shows 123 bytes used.

GuitarPicker's solution had me thinking of a better way; unfortunately there is no if/else in Commodore BASIC v2 but this is probably more efficient than my previous one. Althoug BASIC 7 does have this facility for the Commodore 128 (native).

I've taken out the infinite loop in the previous version and not initialised the i variable as you don't need to do that - saving 9 bytes.

Saved another byte because goto in CBM BASIC V2 assumes goto 0 if no number is entered, so removed the on...goto0 saving a whole token!

Further minimisation has meant that I could add end to like 0, hence removing 1 end and moving up line to for the sub-routine, saving another few bytes.

Title: Print/Output the L-phabet

Body:
Inspired by George Gibson's Print a Tabula Recta.

You are to print/output this exact text:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

(Yes, I typed that by hand)

You are allowed to use all lowercase instead of all uppercase.

However, your choice of case must be consistent throughout the whole text.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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 leaderboard snippet:

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

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 87064; // 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 = 48934; // 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,]*[^\s,]),.*?(\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,
      });

  });

  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;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) 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}

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

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

table thead {
  font-weight: bold;
}

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

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Commodore 64 195 bytes 182 bytes 135 bytes 126 bytes 123 122 tokenised BASIC bytes

Here is a version for the Commodore 64 (will also work with other Commodore BASIC most likely) - although the machine only displays 25 rows in BASIC by default, you can at least see the first row as BASIC is slow.

 0 x=0:fory=i+65to90:on-(i>0)and-(x=0)gosub1:printchr$(y);:next:print:i=i+1:on-(i<26)goto:end
 1 x=1:forz=1toi:printchr$(y);:next:return

Written with CBM prg Studio. I'll see if I can work out a 6502 version at some point.

print 38911-(fre(0)-65536*(fre(0)<0)) shows 123 bytes used.

GuitarPicker's solution had me thinking of a better way; unfortunately there is no if/else in Commodore BASIC v2 but this is probably more efficient than my previous one. Althoug BASIC 7 does have this facility for the Commodore 128 (native).

I've taken out the infinite loop in the previous version and not initialised the i variable as you don't need to do that - saving 9 bytes.

Saved another byte because goto in CBM BASIC V2 assumes goto 0 if no number is entered, so removed the on...goto0 saving a whole token!

Further minimisation has meant that I could add end to like 0, hence removing 1 end and moving up line to for the sub-routine, saving another few bytes.


Body:
PHP, <s>68</s> 63 bytes

for($a=$argv;$a[2]<=$a[3];)$o+=strstr($a[2]++,$a[1])>'';echo$o;

use like:

 php -r "for($a=$argv;$a[2]<=$a[3];)$o+=strstr($a[2]++,$a[1])>'';echo$o;" 3 1 100

edit: 5 bytes saved thanks to Titus


答:
C#, 71 bytes

Beat my Java answer thanks to lambdas

```<code>(t,l,u)=>{int d=0;for(;l<=u;)if((l+++"").Contains(t+""))d++;return d;};
</code>```

Body:
C#, 71 bytes

Beat my Java answer thanks to lambdas

(t,l,u)=>{int d=0;for(;l<=u;)if((l+++"").Contains(t+""))d++;return d;};


答:
QBIC, 18 bytes

```<code>;?left$$|(A,_lA|/2)
</code>```

; gets a command line parameter, then we print the left half of it using _l. Works fine for even and odd-length strings.

Title: Depalindromize this string!

Body:
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

Remember, this is code-golf, so the code with the fewest bytes wins.

Body:
QBIC, 18 bytes

;?left$$|(A,_lA|/2)

; gets a command line parameter, then we print the left half of it using _l. Works fine for even and odd-length strings.


答:
Racket 48 bytes

```<code>(substring s 0(+ 1(floor(/(string-length s)2))))
</code>```

Ungolfed:

```<code>(define (f s)
  (substring s 0 (+ 1
                    (floor
                     (/ (string-length s)
                        2)))))
</code>```

Testing:

```<code>(f "abcdedcba")
(f "johncenanecnhoj")
(f "ppapapp")
(f "codegolflogedoc")
</code>```

Output:

```<code>"abcde"
"johncena"
"ppap"
"codegolf"
</code>```

Title: Depalindromize this string!

Body:
Racket 48 bytes

(substring s 0(+ 1(floor(/(string-length s)2))))

Ungolfed:

(define (f s)
  (substring s 0 (+ 1
                    (floor
                     (/ (string-length s)
                        2)))))

Testing:

(f "abcdedcba")
(f "johncenanecnhoj")
(f "ppapapp")
(f "codegolflogedoc")

Output:

"abcde"
"johncena"
"ppap"
"codegolf"


答:
Bash, 20 bytes

the obvious answer

```<code>seq $2 $3|grep -c $1
</code>```

example

```<code>$ bash golf 3 1 100
19
</code>```

Body:
The program should take input the number, the start of the range and the end of the range, and output how many integers the number appears between the start and end of the range, inclusive. Both programs and functions are allowed.

Example Inputs

For example:

```<code>//Input example 1
3,1,100
//Input example 2
3
1
100
//Input example 3
3 1 100
//Input example 4
a(3, 1, 100);
</code>```

All the above four input examples are valid and all of them mean that 3 is the number in question, 1 is the beginning of the range and 100 the the end of the range.

And then the program should output how many times 3 appears in the range from 1 to 100 inclusive. 3 appears in the integers 3, 13, 23, 30, 31, 32, 33, ..., 93 at a total of 19 times. So the program should output 19 as the output because that is how many times 3 appears in the range from 1 to 100.

Rules

Both programs and functions are allowed.

All numbers will be integers, meaning that there will not be any floats or doubles.

Note: the sought number will always be in the range 0≤x≤127. There will be no cases where it will be outside this 0≤x≤127 range.

As in the first example, with the case as 33, the number 3 will be counted as appearing only once, not twice.

The values of the start and end of the range will be between -65536 and 65535 inclusive.

The value of range's start will never exceed or equal to range's end. start < end

Also the range is inclusive. For example if the input was 8 8 10, the range would be 8≤x≤10 and hence the output will be 1.

Input can be taken in any of the ways shown in the examples. Input can be taken as a string or as a number, any way you wish.

Test Cases

```<code>3 1 100
19

3 3 93
19

12,-200,200
24          //This is because 12 appears in -129, -128, ..., -112, -12, 12, 112, 120, 121, 122, ...

123,1,3
0           //This is because all of 123's digits have to appear in the same order

3 33 34
2           //Because 3 appears in 2 numbers: 33 and 34

a(0,-1,1);
1

$ java NotVerbose 127 -12 27
0
</code>```

Snack Snippet

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 leaderboard snippet:

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

/* Configuration */

var QUESTION_ID = 98470; // 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 = 41805; // 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,]*[^\s,]),.*?(\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,
      });

  });

  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;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) 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}

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

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

table thead {
  font-weight: bold;
}

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

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Bash, 20 bytes

the obvious answer

seq $2 $3|grep -c $1

example

$ bash golf 3 1 100
19


问:
Decode Baby-talk!
When babies open their mouths, they're not just spewing gibberish. They're actually talking in a highly advanced, adult-proof cipher...

The Baby-talk Cipher

When a baby talks, it could look something like gogooa gagooook aagaaoooy
Each single-space separated section represents a character (so the example above represents 3 characters).

To decipher a section, we must count number of As and Os it contains. However, we only count those which are adjacent to another vowel. For example, the A in 'gag' would not count, but both the A and O in 'gaog' would.

Counting the example above would look like this:

```<code>Section    | Num Os | Num As

gogooa     | 2      | 1
gagooook   | 4      | 0
aagaaoooy  | 3      | 4
</code>```

We then use these values to convert the input into plaintext on a Polybius square. This is a 5x5 representation of the English alphabet, omitting 'J' (please note that, in baby-talk, 0-counting rules apply to the table):

```<code>  0 1 2 3 4
0 A B C D E
1 F G H I K
2 L M N O P
3 Q R S T U
4 V W X Y Z
</code>```

Using the number of Os as the column, and number of As as the row, we find which character each section represents:

```<code>Section    | Num Os | Num As | Character

gogooa     | 2      | 1      | (2,1) -> H
gagooook   | 4      | 0      | (4,0) -> E
aagaaoooy  | 3      | 4      | (3,4) -> Y
</code>```

Which tells us that the baby was just saying "HEY".

Notes:

- If a section representing a character has more than 4 As or Os, ignore the extras, because 4 is the maximum value on the table.
- For this task, Y is not a vowel - only A, E, I, O and U.

The Challenge

Your task is to create a full program which takes one input, a word in baby-speak, and prints it in plaintext.

Your program must be able to take input in uppercase, lowercase, and a mix of both.

The input will only contain ASCII alphabet letters (A-Z and a-z), with single spaces to seperate the baby words.

The output text can be in any case.

You should the take the input from STDIN and print the plaintext on STDOUT. If your language does not have these, use the nearest equivalent.

This is code-golf, so the shortest code in bytes wins - but any solution is welcome.

Test Cases

```<code>'GLOOG KAKAAOOO ARGOOO OOOOOGUGUU' -> CODE
'oaka pooopaa gaau augu' -> GOLF
'Aoao U oOOAoa oaoAoo aoAoAOa' -> NAPPY
'GUG gAGaA gOougOou' -> ALE
'OOaGOG GoGOOoGoU gAA bLAA GOUGoOUgAIGAI' -> HELLO
</code>```

答:
Python 3, <s>163</s> <s>162</s> <s>157</s> 146 bytes

import re
for W in input().upper().split():S=''.join(re.findall("[AEIOU]{2,}",W)).count;I=min(S('A'),4)*5+min(S('O'),4);print(end=chr(65+I+(I>9)))
```

Uses regex to find all string of vowels larger than 2, counts As and Os with maximum of 4, and then prints.

Title: Decode Baby-talk!

Body:
Python 3, <s>163</s> <s>162</s> <s>157</s> 146 bytes

import re
for W in input().upper().split():S=''.join(re.findall("[AEIOU]{2,}",W)).count;I=min(S('A'),4)*5+min(S('O'),4);print(end=chr(65+I+(I>9)))

Uses regex to find all string of vowels larger than 2, counts As and Os with maximum of 4, and then prints.


答:
Dip, 8 bytes

```<code>H{C'0ÏEI
</code>```

Explanation:

```<code>           # Implicit input
 H         # Push length of input
  {        # Add 1
   C       # Divide by 2
    '      # Convert to int
     0Ï    # Get string back
       E   # Push prefixes of string
        I  # Push prefixes[a]
           # Implicit print
</code>```

This could probably be much improved.

Title: Depalindromize this string!

Body:
Dip, 8 bytes

H{C'0ÏEI

Explanation:

           # Implicit input
 H         # Push length of input
  {        # Add 1
   C       # Divide by 2
    '      # Convert to int
     0Ï    # Get string back
       E   # Push prefixes of string
        I  # Push prefixes[a]
           # Implicit print

This could probably be much improved.


答:
C, 81 bytes

```<code>f(int n){int m;l:if(++n%3){for(m=n;m>0;m/=10)if(m%10==3)goto l;return n;}goto l;}
</code>```

Title: Count without 3

Body:
C, 81 bytes

f(int n){int m;l:if(++n%3){for(m=n;m>0;m/=10)if(m%10==3)goto l;return n;}goto l;}