Skip to main content
Commonmark migration
Source Link

##Pyth, 20 16 14 bytes

Pyth, 20 16 14 bytes

hol@GNf!-GrT0.:

Explanation:

             .: - substrings of input()
      f!-GrT0   - filter to ones which contain the alphabet
 ol@GN          - sort by number of alphabetical chars
h               - ^[0]

      f!-GrT0   - filter(lambda T:V, substrings)
          rT0   -    T.lower()
        -G      -   alphabet-^
       !        -  not ^

 o              - sort(^, lambda N:V)
   @GN          -   filter_presence(alphabet, N)
  l             -  len(^)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

##Pyth, 20 16 14 bytes

hol@GNf!-GrT0.:

Explanation:

             .: - substrings of input()
      f!-GrT0   - filter to ones which contain the alphabet
 ol@GN          - sort by number of alphabetical chars
h               - ^[0]

      f!-GrT0   - filter(lambda T:V, substrings)
          rT0   -    T.lower()
        -G      -   alphabet-^
       !        -  not ^

 o              - sort(^, lambda N:V)
   @GN          -   filter_presence(alphabet, N)
  l             -  len(^)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

Pyth, 20 16 14 bytes

hol@GNf!-GrT0.:

Explanation:

             .: - substrings of input()
      f!-GrT0   - filter to ones which contain the alphabet
 ol@GN          - sort by number of alphabetical chars
h               - ^[0]

      f!-GrT0   - filter(lambda T:V, substrings)
          rT0   -    T.lower()
        -G      -   alphabet-^
       !        -  not ^

 o              - sort(^, lambda N:V)
   @GN          -   filter_presence(alphabet, N)
  l             -  len(^)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

added 16 characters in body
Source Link
Blue
  • 28.6k
  • 8
  • 52
  • 100

##Pyth, 20 16 1514 bytes

ho@GNfg.{rT0Ghol@GNf!-GrT0.:

Explanation:

             .: - substrings of input()
     fg.{rT0G f!-GrT0   - filter to ones which contain the alphabet
 o@GN ol@GN          - sort by number of alphabetical chars
h               - ^[0]

     fg.{rT0G f!-GrT0   - filter(lambda T:V, substrings)
         rT0 rT0   -    T.lower()
       .{ -G      -   set(alphabet-^)
      g !    G    -  is_subset(^,not alphabet)^

 o              - sort(^, lambda N:V)
  @GN @GN          -   filter_presence(alphabet, N)
  l             -  len(^)

Try it here!Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

##Pyth, 20 16 15 bytes

ho@GNfg.{rT0G.:

Explanation:

             .: - substrings of input()
     fg.{rT0G   - filter to ones which contain the alphabet
 o@GN           - sort by number of alphabetical chars
h               - ^[0]

     fg.{rT0G   - filter(lambda T:V, substrings)
         rT0    -    T.lower()
       .{       -   set(^)
      g     G   -  is_subset(^, alphabet)

 o              - sort(^, lambda N:V)
  @GN           -  filter_presence(alphabet, N)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

##Pyth, 20 16 14 bytes

hol@GNf!-GrT0.:

Explanation:

             .: - substrings of input()
      f!-GrT0   - filter to ones which contain the alphabet
 ol@GN          - sort by number of alphabetical chars
h               - ^[0]

      f!-GrT0   - filter(lambda T:V, substrings)
          rT0   -    T.lower()
        -G      -   alphabet-^
       !        -  not ^

 o              - sort(^, lambda N:V)
   @GN          -   filter_presence(alphabet, N)
  l             -  len(^)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

added 98 characters in body
Source Link
Blue
  • 28.6k
  • 8
  • 52
  • 100

##Pyth, 20 16 15 bytes

ho@GNfg.{rT0G.:

Explanation:

             .: - substrings of input()
     fg.{rT0G   - filter to ones which contain the alphabet
 o@GN           - sort by number of alphabetical chars
h               - ^[0]

     fg.{rT0G   - filter(lambda T:V, substrings)
         rT0    -    T.lower()
       .{       -   set(^)
      g     G   -  is_subset(^, alphabet)

 o              - sort(^, lambda N:V)
  @GN           -  filter_presence(alphabet, N)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

##Pyth, 20 16 15 bytes

ho@GNfg.{rT0G.:

Explanation:

             .: - substrings of input()
     fg.{rT0G   - filter to ones which contain the alphabet
 o@GN           - sort by number of alphabetical chars
h               - ^[0]

     fg.{rT0G   - filter(lambda T:V, substrings)
         rT0    -    T.lower()
       .{       -   set(^)
      g     G   -  is_subset(^, alphabet)

 o              - sort(^, lambda N:V)
  @GN           -  filter_presence(alphabet, N)

Try it here!

##Pyth, 20 16 15 bytes

ho@GNfg.{rT0G.:

Explanation:

             .: - substrings of input()
     fg.{rT0G   - filter to ones which contain the alphabet
 o@GN           - sort by number of alphabetical chars
h               - ^[0]

     fg.{rT0G   - filter(lambda T:V, substrings)
         rT0    -    T.lower()
       .{       -   set(^)
      g     G   -  is_subset(^, alphabet)

 o              - sort(^, lambda N:V)
  @GN           -  filter_presence(alphabet, N)

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

golfed!
Source Link
Blue
  • 28.6k
  • 8
  • 52
  • 100
Loading
Source Link
Blue
  • 28.6k
  • 8
  • 52
  • 100
Loading