First Number to Contain Each LetterEnglish numeral calculatorCardinal Numbers in Standard American EnglishFour is the magic numberHow many letters in this word?Integer goes back and forth through timeEfficient countingIs the date alphabetical?

Splitting polygons at narrowest part using R?

What does "se jouer" mean here?

To which airspace does the border of two adjacent airspaces belong to?

Generate points for smooth movement between two given points

Why didn't Thatcher give Hong Kong to Taiwan?

Everyone for non livings

Are there photos of the Apollo LM showing disturbed lunar soil resulting from descent engine exhaust?

Archiving processor does not archive

Why did the VIC-II and SID use 6 µm technology in the era of 3 µm and 1.5 µm?

Too many SOQL Queries when inserting records

Is mathematics truth?

How do you manage to study and have a balance in your life at the same time?

If p-value is exactly 1 (1.0000000), what are the confidence interval limits?

Do I need to get a noble in order to win Splendor?

Is it safe for a student to give negative feedback in student evaluations?

Can a country avoid prosecution for crimes against humanity by denying it happened?

Did Alan Turing's student Robin Gandy assert that Charles Babbage had no notion of a universal computing machine?

Why do old games use flashing as means of showing damage?

Can I sleep overnight at Stansted Airport

Is it possible to observe space debris with Binoculars?

If I have an accident, should I file a claim with my car insurance company?

How to find better food in airports

Count rook moves 1D

What is this red bug infesting some trees in southern Germany?



First Number to Contain Each Letter


English numeral calculatorCardinal Numbers in Standard American EnglishFour is the magic numberHow many letters in this word?Integer goes back and forth through timeEfficient countingIs the date alphabetical?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








11












$begingroup$


Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so 101 is "one hundred one", not "one hundred and one". Assume American (short-scale) counting, so one million is 10^6 and one billion is 10^9.



a 1000 one thousand
b 1000000000 one billion
c 1000000000000000000000000000 one octillion
d 100 one hundred
e 0 zero
f 4 four
g 8 eight
h 3 three
i 5 five
j
k
l 11 eleven
m 1000000 one million
n 1 one
o 0 zero
p 1000000000000000000000000 one septillion
q 1000000000000000 one quadrillion
r 0 zero
s 6 six
t 2 two
u 4 four
v 5 five
w 2 two
x 6 six
y 20 twenty
z 0 zero


J and K are not part of the input specification, so your behavior is undefined for them. Given one of the above letters, output the (decimal) number next to it. You can take input in lowercase or uppercase, but you cannot require that some inputs are lowercase and others uppercase.



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










share|improve this question











$endgroup$









  • 6




    $begingroup$
    I'm not quite sure why this challenge has been downvoted so much? As far as I can see, it's clear and on-topic. Sure it's most likely to simply be encoding each letter to its corresponding number, but I don't think that justifies 3 downvotes?
    $endgroup$
    – caird coinheringaahing
    8 hours ago










  • $begingroup$
    didn't downvote, but fwiw even though it's strictly not required, it would have helped for clarity to list the names of the numbers. it's nothing more than a kolmogoriv-complexity / compression problem, but somehow that's not immediately clear from the description. input domain: a..z. output: defined by this table. actual ## sections like that would also help.
    $endgroup$
    – Jonah
    3 hours ago







  • 1




    $begingroup$
    @Jonah added, thanks for the feedback
    $endgroup$
    – Stephen
    3 hours ago










  • $begingroup$
    You're saying "one bajillion" isn't a real number?
    $endgroup$
    – Jo King
    1 hour ago










  • $begingroup$
    @JoKing what's it's decimal representation? :)
    $endgroup$
    – Stephen
    1 hour ago

















11












$begingroup$


Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so 101 is "one hundred one", not "one hundred and one". Assume American (short-scale) counting, so one million is 10^6 and one billion is 10^9.



a 1000 one thousand
b 1000000000 one billion
c 1000000000000000000000000000 one octillion
d 100 one hundred
e 0 zero
f 4 four
g 8 eight
h 3 three
i 5 five
j
k
l 11 eleven
m 1000000 one million
n 1 one
o 0 zero
p 1000000000000000000000000 one septillion
q 1000000000000000 one quadrillion
r 0 zero
s 6 six
t 2 two
u 4 four
v 5 five
w 2 two
x 6 six
y 20 twenty
z 0 zero


J and K are not part of the input specification, so your behavior is undefined for them. Given one of the above letters, output the (decimal) number next to it. You can take input in lowercase or uppercase, but you cannot require that some inputs are lowercase and others uppercase.



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










share|improve this question











$endgroup$









  • 6




    $begingroup$
    I'm not quite sure why this challenge has been downvoted so much? As far as I can see, it's clear and on-topic. Sure it's most likely to simply be encoding each letter to its corresponding number, but I don't think that justifies 3 downvotes?
    $endgroup$
    – caird coinheringaahing
    8 hours ago










  • $begingroup$
    didn't downvote, but fwiw even though it's strictly not required, it would have helped for clarity to list the names of the numbers. it's nothing more than a kolmogoriv-complexity / compression problem, but somehow that's not immediately clear from the description. input domain: a..z. output: defined by this table. actual ## sections like that would also help.
    $endgroup$
    – Jonah
    3 hours ago







  • 1




    $begingroup$
    @Jonah added, thanks for the feedback
    $endgroup$
    – Stephen
    3 hours ago










  • $begingroup$
    You're saying "one bajillion" isn't a real number?
    $endgroup$
    – Jo King
    1 hour ago










  • $begingroup$
    @JoKing what's it's decimal representation? :)
    $endgroup$
    – Stephen
    1 hour ago













11












11








11





$begingroup$


Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so 101 is "one hundred one", not "one hundred and one". Assume American (short-scale) counting, so one million is 10^6 and one billion is 10^9.



a 1000 one thousand
b 1000000000 one billion
c 1000000000000000000000000000 one octillion
d 100 one hundred
e 0 zero
f 4 four
g 8 eight
h 3 three
i 5 five
j
k
l 11 eleven
m 1000000 one million
n 1 one
o 0 zero
p 1000000000000000000000000 one septillion
q 1000000000000000 one quadrillion
r 0 zero
s 6 six
t 2 two
u 4 four
v 5 five
w 2 two
x 6 six
y 20 twenty
z 0 zero


J and K are not part of the input specification, so your behavior is undefined for them. Given one of the above letters, output the (decimal) number next to it. You can take input in lowercase or uppercase, but you cannot require that some inputs are lowercase and others uppercase.



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










share|improve this question











$endgroup$




Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so 101 is "one hundred one", not "one hundred and one". Assume American (short-scale) counting, so one million is 10^6 and one billion is 10^9.



a 1000 one thousand
b 1000000000 one billion
c 1000000000000000000000000000 one octillion
d 100 one hundred
e 0 zero
f 4 four
g 8 eight
h 3 three
i 5 five
j
k
l 11 eleven
m 1000000 one million
n 1 one
o 0 zero
p 1000000000000000000000000 one septillion
q 1000000000000000 one quadrillion
r 0 zero
s 6 six
t 2 two
u 4 four
v 5 five
w 2 two
x 6 six
y 20 twenty
z 0 zero


J and K are not part of the input specification, so your behavior is undefined for them. Given one of the above letters, output the (decimal) number next to it. You can take input in lowercase or uppercase, but you cannot require that some inputs are lowercase and others uppercase.



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







code-golf number kolmogorov-complexity






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago







Stephen

















asked 9 hours ago









StephenStephen

8,0352 gold badges36 silver badges102 bronze badges




8,0352 gold badges36 silver badges102 bronze badges










  • 6




    $begingroup$
    I'm not quite sure why this challenge has been downvoted so much? As far as I can see, it's clear and on-topic. Sure it's most likely to simply be encoding each letter to its corresponding number, but I don't think that justifies 3 downvotes?
    $endgroup$
    – caird coinheringaahing
    8 hours ago










  • $begingroup$
    didn't downvote, but fwiw even though it's strictly not required, it would have helped for clarity to list the names of the numbers. it's nothing more than a kolmogoriv-complexity / compression problem, but somehow that's not immediately clear from the description. input domain: a..z. output: defined by this table. actual ## sections like that would also help.
    $endgroup$
    – Jonah
    3 hours ago







  • 1




    $begingroup$
    @Jonah added, thanks for the feedback
    $endgroup$
    – Stephen
    3 hours ago










  • $begingroup$
    You're saying "one bajillion" isn't a real number?
    $endgroup$
    – Jo King
    1 hour ago










  • $begingroup$
    @JoKing what's it's decimal representation? :)
    $endgroup$
    – Stephen
    1 hour ago












  • 6




    $begingroup$
    I'm not quite sure why this challenge has been downvoted so much? As far as I can see, it's clear and on-topic. Sure it's most likely to simply be encoding each letter to its corresponding number, but I don't think that justifies 3 downvotes?
    $endgroup$
    – caird coinheringaahing
    8 hours ago










  • $begingroup$
    didn't downvote, but fwiw even though it's strictly not required, it would have helped for clarity to list the names of the numbers. it's nothing more than a kolmogoriv-complexity / compression problem, but somehow that's not immediately clear from the description. input domain: a..z. output: defined by this table. actual ## sections like that would also help.
    $endgroup$
    – Jonah
    3 hours ago







  • 1




    $begingroup$
    @Jonah added, thanks for the feedback
    $endgroup$
    – Stephen
    3 hours ago










  • $begingroup$
    You're saying "one bajillion" isn't a real number?
    $endgroup$
    – Jo King
    1 hour ago










  • $begingroup$
    @JoKing what's it's decimal representation? :)
    $endgroup$
    – Stephen
    1 hour ago







6




6




$begingroup$
I'm not quite sure why this challenge has been downvoted so much? As far as I can see, it's clear and on-topic. Sure it's most likely to simply be encoding each letter to its corresponding number, but I don't think that justifies 3 downvotes?
$endgroup$
– caird coinheringaahing
8 hours ago




$begingroup$
I'm not quite sure why this challenge has been downvoted so much? As far as I can see, it's clear and on-topic. Sure it's most likely to simply be encoding each letter to its corresponding number, but I don't think that justifies 3 downvotes?
$endgroup$
– caird coinheringaahing
8 hours ago












$begingroup$
didn't downvote, but fwiw even though it's strictly not required, it would have helped for clarity to list the names of the numbers. it's nothing more than a kolmogoriv-complexity / compression problem, but somehow that's not immediately clear from the description. input domain: a..z. output: defined by this table. actual ## sections like that would also help.
$endgroup$
– Jonah
3 hours ago





$begingroup$
didn't downvote, but fwiw even though it's strictly not required, it would have helped for clarity to list the names of the numbers. it's nothing more than a kolmogoriv-complexity / compression problem, but somehow that's not immediately clear from the description. input domain: a..z. output: defined by this table. actual ## sections like that would also help.
$endgroup$
– Jonah
3 hours ago





1




1




$begingroup$
@Jonah added, thanks for the feedback
$endgroup$
– Stephen
3 hours ago




$begingroup$
@Jonah added, thanks for the feedback
$endgroup$
– Stephen
3 hours ago












$begingroup$
You're saying "one bajillion" isn't a real number?
$endgroup$
– Jo King
1 hour ago




$begingroup$
You're saying "one bajillion" isn't a real number?
$endgroup$
– Jo King
1 hour ago












$begingroup$
@JoKing what's it's decimal representation? :)
$endgroup$
– Stephen
1 hour ago




$begingroup$
@JoKing what's it's decimal representation? :)
$endgroup$
– Stephen
1 hour ago










8 Answers
8






active

oldest

votes


















5














$begingroup$


JavaScript (Node.js), 78 bytes





c=>(B=Buffer,n=B('8>P7 $(#% +;! MD &"$%"&4 '[B(c)[0]-97])[0]-53)<0?n+21:10**n


Try it online!



How?



Each value is encoded with a single printable character. We use the ASCII range $[32..52]$ to encode $n-32$ and the range $[53..80]$ to encode $10^n-53$.






share|improve this answer











$endgroup$






















    3














    $begingroup$


    ///, 125 bytes



    /://///T/000:d/100:a/d0:m/aT:b/aTT:q/bTT:p/qTTT:c/pT:e/0:f/4:g/8:h/3:i/5:l/11:n/1:o/0:r/0:s/6:t/2:u/4:v/5:w/2:x/6:y/20:z/0/


    Try it online!



    Input is appended to the end of the code, as per I/O meta. The footer in the above TIO link tests all letters simultaneously, as a single newline-delimited string, but the code also works just fine when inputting a single character.






    share|improve this answer









    $endgroup$






















      3














      $begingroup$


      Ruby, 70 bytes





      ->ni="cib@DHCE@@KfA@xo@FBDEBFT@"[n.ord-65].ord;i>96?10**(i-96):i-64}


      Try it online!






      share|improve this answer









      $endgroup$














      • $begingroup$
        67 bytes
        $endgroup$
        – G B
        4 hours ago


















      1














      $begingroup$


      Wolfram Language (Mathematica), 50 bytes



      Letters b, c, m, p and q are skipped for performance reasons when testing on TIO.



      (i=0;While[1>StringCount[IntegerName@i,#],i++];i)&


      Try it online!






      share|improve this answer









      $endgroup$






















        1














        $begingroup$


        Jelly, 36 bytes



        Oị“[@ịẆþĊ`o&÷ḲḞṘḂỊP¥t’b48¤_⁹⁵*ɗ¹>?20


        Try it online!



        A monadic link taking a lower case letter as its argument and returning an integer. Returns 0 for j and k.



        Explanation



        O | Convert to code point
        ị ¤ | Index into following as a nilad (wraps around):
        “[...t’ | - Integer 5370441668223940717846370165240010583188867 (stored base 250)
        b48 | - Convert to base 48
        ɗ >?20 | If >20, following as a dyad using 20 as right argument:
        _⁹ | - Subtract right argument (20)
        ⁵* | - 10 to the power of this
        ¹ | Else: leave unchanged (identity function)





        share|improve this answer











        $endgroup$






















          1














          $begingroup$


          Retina 0.8.2, 89 bytes



          ^
          $'
          T`l`111104835__111011062452620`^.
          T`abcmpq`139285
          d$
          $*0$&$*0$&$*0
          d
          00
          T`lyl`10_


          Try it online! Link includes test cases. Explanation:



          ^
          $'


          Duplicate the input.



          T`l`111104835__111011062452620`^.


          Change the first copy to the (first) digit of the relevant result.



          T`abcmpq`139285


          If the number has a multiple of 3 trailing zeros, get that multiple now.



          d$
          $*0$&$*0$&$*0


          And actually convert it into the relevant number of trailing zeros. (Note that this would simplify to *3*0 in Retina 1.)



          d
          00


          Fix up d.



          T`lyl`10_


          Fix up l and y and remove any remaining letters.






          share|improve this answer









          $endgroup$






















            1














            $begingroup$


            C# (Visual C# Interactive Compiler), 77 bytes





            x=>(d[x-='A']&15)*Math.Pow(10,d[x]>>4);var d="1‘Ʊ! aƁñ"


            Try it online!



            Each value is encoded as a 9 bit sequence: the first 5 bits are the number of 0's after the number, and the last 4 bits encodes the number with all the zeros trimmed.



            Example: 1000 -> 11001






            share|improve this answer









            $endgroup$






















              1














              $begingroup$


              Stax, 33 bytes



              º░¡µ?Äz*B╥╪╩ΓoΣ4ù↓|♂5%⌡ÿΩ²┼himprove this answer








              edited 7 hours ago

























              answered 8 hours ago









              ArnauldArnauld

              91.7k7 gold badges108 silver badges373 bronze badges




              91.7k7 gold badges108 silver badges373 bronze badges













                share|improve this answer









                $endgroup$














                • $begingroup$
                  67 bytes
                  $endgroup$
                  – G B
                  4 hours ago















                3














                $begingroup$


                Ruby, 70 bytes





                ->ni="cib@DHCE@@KfA@xo@FBDEBFT@"[n.ord-65].ord;i>96?10**(i-96):i-64}


                Try it online!






                share|improve this answer









                $endgroup$














                • $begingroup$
                  67 bytes
                  $endgroup$
                  – G B
                  4 hours ago













                3














                3










                3







                $begingroup$


                Ruby, 70 bytes





                ->ni="cib@DHCE@@KfA@xo@FBDEBFT@"[n.ord-65].ord;i>96?10**(i-96):i-64}


                Try it online!






                share|improve this answer









                $endgroup$




                Ruby, 70 bytes





                ->ni="cib@DHCE@@KfA@xo@FBDEBFT@"[n.ord-65].ord;i>96?10**(i-96):i-64}


                Try it online!







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 4 hours ago









                Level River StLevel River St

                20.8k4 gold badges27 silver badges86 bronze badges




                20.8k4 gold badges27 silver badges86 bronze badges














                • $begingroup$
                  67 bytes
                  $endgroup$
                  – G B
                  4 hours ago
















                • $begingroup$
                  67 bytes
                  $endgroup$
                  – G B
                  4 hours ago















                $begingroup$
                67 bytes
                $endgroup$
                – G B
                4 hours ago




                $begingroup$
                67 bytes
                $endgroup$
                – G B
                4 hours ago











                1














                $begingroup$


                Wolfram Language (Mathematica), 50 bytes



                Letters b, c, m, p and q are skipped for performance reasons when testing on TIO.



                (i=0;While[1>StringCount[IntegerName@i,#],i++];i)&


                Try it online!






                share|improve this answer









                $endgroup$



















                  1














                  $begingroup$


                  Wolfram Language (Mathematica), 50 bytes



                  Letters b, c, m, p and q are skipped for performance reasons when testing on TIO.



                  (i=0;While[1>StringCount[IntegerName@i,#],i++];i)&


                  Try it online!






                  share|improve this answer









                  $endgroup$

















                    1














                    1










                    1







                    $begingroup$


                    Wolfram Language (Mathematica), 50 bytes



                    Letters b, c, m, p and q are skipped for performance reasons when testing on TIO.



                    (i=0;While[1>StringCount[IntegerName@i,#],i++];i)&


                    Try it online!






                    share|improve this answer









                    $endgroup$




                    Wolfram Language (Mathematica), 50 bytes



                    Letters b, c, m, p and q are skipped for performance reasons when testing on TIO.



                    (i=0;While[1>StringCount[IntegerName@i,#],i++];i)&


                    Try it online!







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 6 hours ago









                    someonesomeone

                    1,11010 silver badges26 bronze badges




                    1,11010 silver badges26 bronze badges
























                        1














                        $begingroup$


                        Jelly, 36 bytes



                        Oị“[@ịẆþĊ`o&÷ḲḞṘḂỊP¥t’b48¤_⁹⁵*ɗ¹>?20


                        Try it online!



                        A monadic link taking a lower case letter as its argument and returning an integer. Returns 0 for j and k.



                        Explanation



                        O | Convert to code point
                        ị ¤ | Index into following as a nilad (wraps around):
                        “[...t’ | - Integer 5370441668223940717846370165240010583188867 (stored base 250)
                        b48 | - Convert to base 48
                        ɗ >?20 | If >20, following as a dyad using 20 as right argument:
                        _⁹ | - Subtract right argument (20)
                        ⁵* | - 10 to the power of this
                        ¹ | Else: leave unchanged (identity function)





                        share|improve this answer











                        $endgroup$



















                          1














                          $begingroup$


                          Jelly, 36 bytes



                          Oị“[@ịẆþĊ`o&÷ḲḞṘḂỊP¥t’b48¤_⁹⁵*ɗ¹>?20


                          Try it online!



                          A monadic link taking a lower case letter as its argument and returning an integer. Returns 0 for j and k.



                          Explanation



                          O | Convert to code point
                          ị ¤ | Index into following as a nilad (wraps around):
                          “[...t’ | - Integer 5370441668223940717846370165240010583188867 (stored base 250)
                          b48 | - Convert to base 48
                          ɗ >?20 | If >20, following as a dyad using 20 as right argument:
                          _⁹ | - Subtract right argument (20)
                          ⁵* | - 10 to the power of this
                          ¹ | Else: leave unchanged (identity function)





                          share|improve this answer











                          $endgroup$

















                            1














                            1










                            1







                            $begingroup$


                            Jelly, 36 bytes



                            Oị“[@ịẆþĊ`o&÷ḲḞṘḂỊP¥t’b48¤_⁹⁵*ɗ¹>?20


                            Try it online!



                            A monadic link taking a lower case letter as its argument and returning an integer. Returns 0 for j and k.



                            Explanation



                            O | Convert to code point
                            ị ¤ | Index into following as a nilad (wraps around):
                            “[...t’ | - Integer 5370441668223940717846370165240010583188867 (stored base 250)
                            b48 | - Convert to base 48
                            ɗ >?20 | If >20, following as a dyad using 20 as right argument:
                            _⁹ | - Subtract right argument (20)
                            ⁵* | - 10 to the power of this
                            ¹ | Else: leave unchanged (identity function)





                            share|improve this answer











                            $endgroup$




                            Jelly, 36 bytes



                            Oị“[@ịẆþĊ`o&÷ḲḞṘḂỊP¥t’b48¤_⁹⁵*ɗ¹>?20


                            Try it online!



                            A monadic link taking a lower case letter as its argument and returning an integer. Returns 0 for j and k.



                            Explanation



                            O | Convert to code point
                            ị ¤ | Index into following as a nilad (wraps around):
                            “[...t’ | - Integer 5370441668223940717846370165240010583188867 (stored base 250)
                            b48 | - Convert to base 48
                            ɗ >?20 | If >20, following as a dyad using 20 as right argument:
                            _⁹ | - Subtract right argument (20)
                            ⁵* | - 10 to the power of this
                            ¹ | Else: leave unchanged (identity function)






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 4 hours ago

























                            answered 6 hours ago









                            Nick KennedyNick Kennedy

                            6,4171 gold badge9 silver badges15 bronze badges




                            6,4171 gold badge9 silver badges15 bronze badges
























                                1














                                $begingroup$


                                Retina 0.8.2, 89 bytes



                                ^
                                $'
                                T`l`111104835__111011062452620`^.
                                T`abcmpq`139285
                                d$
                                $*0$&$*0$&$*0
                                d
                                00
                                T`lyl`10_


                                Try it online! Link includes test cases. Explanation:



                                ^
                                $'


                                Duplicate the input.



                                T`l`111104835__111011062452620`^.


                                Change the first copy to the (first) digit of the relevant result.



                                T`abcmpq`139285


                                If the number has a multiple of 3 trailing zeros, get that multiple now.



                                d$
                                $*0$&$*0$&$*0


                                And actually convert it into the relevant number of trailing zeros. (Note that this would simplify to *3*0 in Retina 1.)



                                d
                                00


                                Fix up d.



                                T`lyl`10_


                                Fix up l and y and remove any remaining letters.






                                share|improve this answer









                                $endgroup$



















                                  1














                                  $begingroup$


                                  Retina 0.8.2, 89 bytes



                                  ^
                                  $'
                                  T`l`111104835__111011062452620`^.
                                  T`abcmpq`139285
                                  d$
                                  $*0$&$*0$&$*0
                                  d
                                  00
                                  T`lyl`10_


                                  Try it online! Link includes test cases. Explanation:



                                  ^
                                  $'


                                  Duplicate the input.



                                  T`l`111104835__111011062452620`^.


                                  Change the first copy to the (first) digit of the relevant result.



                                  T`abcmpq`139285


                                  If the number has a multiple of 3 trailing zeros, get that multiple now.



                                  d$
                                  $*0$&$*0$&$*0


                                  And actually convert it into the relevant number of trailing zeros. (Note that this would simplify to *3*0 in Retina 1.)



                                  d
                                  00


                                  Fix up d.



                                  T`lyl`10_


                                  Fix up l and y and remove any remaining letters.






                                  share|improve this answer









                                  $endgroup$

















                                    1














                                    1










                                    1







                                    $begingroup$


                                    Retina 0.8.2, 89 bytes



                                    ^
                                    $'
                                    T`l`111104835__111011062452620`^.
                                    T`abcmpq`139285
                                    d$
                                    $*0$&$*0$&$*0
                                    d
                                    00
                                    T`lyl`10_


                                    Try it online! Link includes test cases. Explanation:



                                    ^
                                    $'


                                    Duplicate the input.



                                    T`l`111104835__111011062452620`^.


                                    Change the first copy to the (first) digit of the relevant result.



                                    T`abcmpq`139285


                                    If the number has a multiple of 3 trailing zeros, get that multiple now.



                                    d$
                                    $*0$&$*0$&$*0


                                    And actually convert it into the relevant number of trailing zeros. (Note that this would simplify to *3*0 in Retina 1.)



                                    d
                                    00


                                    Fix up d.



                                    T`lyl`10_


                                    Fix up l and y and remove any remaining letters.






                                    share|improve this answer









                                    $endgroup$




                                    Retina 0.8.2, 89 bytes



                                    ^
                                    $'
                                    T`l`111104835__111011062452620`^.
                                    T`abcmpq`139285
                                    d$
                                    $*0$&$*0$&$*0
                                    d
                                    00
                                    T`lyl`10_


                                    Try it online! Link includes test cases. Explanation:



                                    ^
                                    $'


                                    Duplicate the input.



                                    T`l`111104835__111011062452620`^.


                                    Change the first copy to the (first) digit of the relevant result.



                                    T`abcmpq`139285


                                    If the number has a multiple of 3 trailing zeros, get that multiple now.



                                    d$
                                    $*0$&$*0$&$*0


                                    And actually convert it into the relevant number of trailing zeros. (Note that this would simplify to *3*0 in Retina 1.)



                                    d
                                    00


                                    Fix up d.



                                    T`lyl`10_


                                    Fix up l and y and remove any remaining letters.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 4 hours ago









                                    NeilNeil

                                    88.3k8 gold badges46 silver badges186 bronze badges




                                    88.3k8 gold badges46 silver badges186 bronze badges
























                                        1














                                        $begingroup$


                                        C# (Visual C# Interactive Compiler), 77 bytes





                                        x=>(d[x-='A']&15)*Math.Pow(10,d[x]>>4);var d="1‘Ʊ! aƁñ"


                                        Try it online!



                                        Each value is encoded as a 9 bit sequence: the first 5 bits are the number of 0's after the number, and the last 4 bits encodes the number with all the zeros trimmed.



                                        Example: 1000 -> 11001






                                        share|improve this answer









                                        $endgroup$



















                                          1














                                          $begingroup$


                                          C# (Visual C# Interactive Compiler), 77 bytes





                                          x=>(d[x-='A']&15)*Math.Pow(10,d[x]>>4);var d="1‘Ʊ! aƁñ"


                                          Try it online!



                                          Each value is encoded as a 9 bit sequence: the first 5 bits are the number of 0's after the number, and the last 4 bits encodes the number with all the zeros trimmed.



                                          Example: 1000 -> 11001






                                          share|improve this answer









                                          $endgroup$

















                                            1














                                            1










                                            1







                                            $begingroup$


                                            C# (Visual C# Interactive Compiler), 77 bytes





                                            x=>(d[x-='A']&15)*Math.Pow(10,d[x]>>4);var d="1‘Ʊ! aƁñ"


                                            Try it online!



                                            Each value is encoded as a 9 bit sequence: the first 5 bits are the number of 0's after the number, and the last 4 bits encodes the number with all the zeros trimmed.



                                            Example: 1000 -> 11001






                                            share|improve this answer









                                            $endgroup$




                                            C# (Visual C# Interactive Compiler), 77 bytes





                                            x=>(d[x-='A']&15)*Math.Pow(10,d[x]>>4);var d="1‘Ʊ! aƁñ"


                                            Try it online!



                                            Each value is encoded as a 9 bit sequence: the first 5 bits are the number of 0's after the number, and the last 4 bits encodes the number with all the zeros trimmed.



                                            Example: 1000 -> 11001







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered 3 hours ago









                                            Embodiment of IgnoranceEmbodiment of Ignorance

                                            5,2161 silver badge30 bronze badges




                                            5,2161 silver badge30 bronze badges
























                                                1














                                                $begingroup$


                                                Stax, 33 bytes



                                                º░¡µ?Äz*B╥╪╩ΓoΣ4ù↓|♂5%⌡ÿΩ²┼h{☻4O└


                                                Run and debug it



                                                Procedure:



                                                1. Extract codepoint from input.

                                                2. Index into constant array [3, 5, 7, 9, 11, -6, 1, 0, -24, -15, 0, 6, 2, 4, 5, 2, 6, 20, 0, -3, -9, -27, -2, 0, 4, 8] using codepoint. (with wrap-around)

                                                3. If the result is negative, negate and raise 10 to that power, otherwise leave as-is.





                                                share|improve this answer









                                                $endgroup$



















                                                  1














                                                  $begingroup$


                                                  Stax, 33 bytes



                                                  º░¡µ?Äz*B╥╪╩ΓoΣ4ù↓|♂5%⌡ÿΩ²┼h{☻4O└


                                                  Run and debug it



                                                  Procedure:



                                                  1. Extract codepoint from input.

                                                  2. Index into constant array [3, 5, 7, 9, 11, -6, 1, 0, -24, -15, 0, 6, 2, 4, 5, 2, 6, 20, 0, -3, -9, -27, -2, 0, 4, 8] using codepoint. (with wrap-around)

                                                  3. If the result is negative, negate and raise 10 to that power, otherwise leave as-is.





                                                  share|improve this answer









                                                  $endgroup$

















                                                    1














                                                    1










                                                    1







                                                    $begingroup$


                                                    Stax, 33 bytes



                                                    º░¡µ?Äz*B╥╪╩ΓoΣ4ù↓|♂5%⌡ÿΩ²┼h{☻4O└


                                                    Run and debug it



                                                    Procedure:



                                                    1. Extract codepoint from input.

                                                    2. Index into constant array [3, 5, 7, 9, 11, -6, 1, 0, -24, -15, 0, 6, 2, 4, 5, 2, 6, 20, 0, -3, -9, -27, -2, 0, 4, 8] using codepoint. (with wrap-around)

                                                    3. If the result is negative, negate and raise 10 to that power, otherwise leave as-is.





                                                    share|improve this answer









                                                    $endgroup$




                                                    Stax, 33 bytes



                                                    º░¡µ?Äz*B╥╪╩ΓoΣ4ù↓|♂5%⌡ÿΩ²┼h{☻4O└


                                                    Run and debug it



                                                    Procedure:



                                                    1. Extract codepoint from input.

                                                    2. Index into constant array [3, 5, 7, 9, 11, -6, 1, 0, -24, -15, 0, 6, 2, 4, 5, 2, 6, 20, 0, -3, -9, -27, -2, 0, 4, 8] using codepoint. (with wrap-around)

                                                    3. If the result is negative, negate and raise 10 to that power, otherwise leave as-is.






                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered 3 hours ago









                                                    recursiverecursive

                                                    8,14615 silver badges32 bronze badges




                                                    8,14615 silver badges32 bronze badges






























                                                        draft saved

                                                        draft discarded
















































                                                        If this is an answer to a challenge…



                                                        • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                        • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                          Explanations of your answer make it more interesting to read and are very much encouraged.


                                                        • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                                        More generally…



                                                        • …Please make sure to answer the question and provide sufficient detail.


                                                        • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                                        draft saved


                                                        draft discarded














                                                        StackExchange.ready(
                                                        function ()
                                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f191223%2ffirst-number-to-contain-each-letter%23new-answer', 'question_page');

                                                        );

                                                        Post as a guest















                                                        Required, but never shown





















































                                                        Required, but never shown














                                                        Required, but never shown












                                                        Required, but never shown







                                                        Required, but never shown

































                                                        Required, but never shown














                                                        Required, but never shown












                                                        Required, but never shown







                                                        Required, but never shown







                                                        Popular posts from this blog

                                                        Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

                                                        The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

                                                        19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу