Skip to main content
Commonmark migration
Source Link

#Pyth, 19 17 14 bytes

Pyth, 19 17 14 bytes

l@jGUTmr0Csd.:

takes a string.

-3 Bytes thanks to @LeakyNun

Try it!

###Explanation l@jGUTmr0Csd.: UT # the list of digits [0,1,2,...,9] jG # join that on the lowercase alphabet (repetition doesn't matter) Q # implicit input .: # all substrings of the input m # for each of those substrings sd # Convert the string to a base 10 integer C # convert that integer to the character with that number r0 # make that character lowercase l@ # length of the intersection of those two list of chars we generated

Explanation

l@jGUTmr0Csd.:
    UT                # the list of digits [0,1,2,...,9]
  jG                  # join that on the lowercase alphabet (repetition doesn't matter)
              Q       # implicit input
            .:        # all substrings of the input
      m               # for each of those substrings
          sd          # Convert the string to a base 10 integer
         C            # convert that integer to the character with that number
       r0             # make that character lowercase
l@                    # length of the intersection of those two list of chars we generated
 

#Pyth, 19 17 14 bytes

l@jGUTmr0Csd.:

takes a string.

-3 Bytes thanks to @LeakyNun

Try it!

###Explanation l@jGUTmr0Csd.: UT # the list of digits [0,1,2,...,9] jG # join that on the lowercase alphabet (repetition doesn't matter) Q # implicit input .: # all substrings of the input m # for each of those substrings sd # Convert the string to a base 10 integer C # convert that integer to the character with that number r0 # make that character lowercase l@ # length of the intersection of those two list of chars we generated

Pyth, 19 17 14 bytes

l@jGUTmr0Csd.:

takes a string.

-3 Bytes thanks to @LeakyNun

Try it!

Explanation

l@jGUTmr0Csd.:
    UT                # the list of digits [0,1,2,...,9]
  jG                  # join that on the lowercase alphabet (repetition doesn't matter)
              Q       # implicit input
            .:        # all substrings of the input
      m               # for each of those substrings
          sd          # Convert the string to a base 10 integer
         C            # convert that integer to the character with that number
       r0             # make that character lowercase
l@                    # length of the intersection of those two list of chars we generated
 
added 24 characters in body
Source Link
KarlKastor
  • 2.4k
  • 1
  • 15
  • 17

#Pyth, 19 1717 14 bytes

l@jG+UTrG1mCidTl@jGUTmr0Csd.:

takes a string.

Try it!-3 Bytes thanks to @LeakyNun

Try it!

###Explanation l@jG+UTrG1mCidTl@jGUTmr0Csd.: rG1 # ConvertUT # the alphabet (G) to uppercase +UT # put that into a list with the ints in range(10)of digits [0,1,2,...,9] jG # join that on the lowercase alphabet (repetition doesn't matter) Q # # implicit input .: # # all substrings of the input m # # for each of those substrings idT #sd # Convert the string to a base 10 (T) integer C # # convert that integer to the character with that number r0 # make that character lowercase l@ # length of the intersection of those two list of chars we generated

#Pyth, 19 17 bytes

l@jG+UTrG1mCidT.:

takes a string.

Try it!

###Explanation l@jG+UTrG1mCidT.: rG1 # Convert the alphabet (G) to uppercase +UT # put that into a list with the ints in range(10) jG # join that on the alphabet (repetition doesn't matter) Q # implicit input .: # all substrings of the input m # for each of those substrings idT # Convert the string to a base 10 (T) integer C # convert that integer to the character with that number l@ # length of the intersection of those two list of chars we generated

#Pyth, 19 17 14 bytes

l@jGUTmr0Csd.:

takes a string.

-3 Bytes thanks to @LeakyNun

Try it!

###Explanation l@jGUTmr0Csd.: UT # the list of digits [0,1,2,...,9] jG # join that on the lowercase alphabet (repetition doesn't matter) Q # implicit input .: # all substrings of the input m # for each of those substrings sd # Convert the string to a base 10 integer C # convert that integer to the character with that number r0 # make that character lowercase l@ # length of the intersection of those two list of chars we generated

added 4 characters in body
Source Link
KarlKastor
  • 2.4k
  • 1
  • 15
  • 17

#Pyth, 19 17 bytes

l@jG+UTrG1mCidT.:

takes a string.

Try it!

###Explanation l@jG+UTrG1mCidT.: rG1 # Convert the alphabet (G) to uppercase +UT # put that into a list with the ints in range(10) jG # join that on the alphabet (repetition doesn't matter) Q # implicit input .: # all substrings of the input m # for each of those substrings idT # Convert the string to a base 10 (T) integer C # convert that integer to the character with that number l@ # length of the intersection of those two list of chars we generated

#Pyth, 19 17 bytes

l@jG+UTrG1mCidT.:

takes a string.

Try it!

#Pyth, 19 17 bytes

l@jG+UTrG1mCidT.:

takes a string.

Try it!

###Explanation l@jG+UTrG1mCidT.: rG1 # Convert the alphabet (G) to uppercase +UT # put that into a list with the ints in range(10) jG # join that on the alphabet (repetition doesn't matter) Q # implicit input .: # all substrings of the input m # for each of those substrings idT # Convert the string to a base 10 (T) integer C # convert that integer to the character with that number l@ # length of the intersection of those two list of chars we generated

added 4 characters in body
Source Link
KarlKastor
  • 2.4k
  • 1
  • 15
  • 17
Loading
Source Link
KarlKastor
  • 2.4k
  • 1
  • 15
  • 17
Loading