Skip to main content
deleted 245 characters in body
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108

The explanation is still for the 44 bytes solution. Gonna change it soon.

lsmf|!@<G5dq%T2}\odlsm-%R2}hKvMc-ecd\:G\-eKceK?}\ed}edGYc-rzZd\,  implicit: z = input string
                                      rzZ     convert z to lower-case
                                     -   d    remove all spaces from z
                                    c     \,  and split by ","
  m                                           map each part d to:
                 cd\:          cd\:                 split d by ":"
                e          e                     and only use the last part (removes page number)
               -     G     -     G                remove all letters (removes odd/even)
            c       \-     c       \-              split by "-"
            vM          vM                        and evaluate all (one or two) numbers
           K          K                          and store the result in K
         }hK          }hK  eK          eK            create the list [K[0], K[0]+1, ..., K[-1]]
   f       %R2                                     filter for numbers Tapply inmodulo this2 list,to whicheach satisfy:element
      @<G5d -                                      the intersection of "abcde" and dremove:
     !                           }\ed                 is empty (no odd/even"e" in d)
    |                                             or
            %T2                               (1 for in, 0 Tfor modnot 2in)
           q               ?    }edG               if d[-1] in "abcde...z" equalselse
               }\od                  Y             "o" indummy dvalue
 s                                            combine all the lists
l                                             print the length      
                                 

The explanation is still for the 44 bytes solution. Gonna change it soon.

lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-rzZd\,  implicit: z = input string
                                      rzZ     convert z to lower-case
                                     -   d    remove all spaces from z
                                    c     \,  and split by ","
  m                                           map each part d to:
                           cd\:                 split d by ":"
                          e                     and only use the last part (removes page number)
                         -     G                remove all letters (removes odd/even)
                        c       \-              split by "-"
                      vM                        and evaluate all (one or two) numbers
                     K                          and store the result in K
                   }hK            eK            create the list [K[0], K[0]+1, ..., K[-1]]
   f                                            filter for numbers T in this list, which satisfy:
      @<G5d                                       the intersection of "abcde" and d
     !                                            is empty (no odd/even in d)
    |                                             or
            %T2                                   T mod 2
           q                                      equals
               }\od                               "o" in d
 s                                            combine all the lists
l                                             print the length      
                             
lsm-%R2}hKvMc-ecd\:G\-eK?}\ed}edGYc-rzZd\,  implicit: z = input string
                                    rzZ     convert z to lower-case
                                   -   d    remove all spaces from z
                                  c     \,  and split by ","
  m                                         map each part d to:
               cd\:                           split d by ":"
              e                               and only use the last part (removes page number)
             -     G                          remove all letters (removes odd/even)
            c       \-                        split by "-"
          vM                                  and evaluate all (one or two) numbers
         K                                    and store the result in K
       }hK            eK                      create the list [K[0], K[0]+1, ..., K[-1]]
    %R2                                       apply modulo 2 to each element
   -                                          and remove:
                         }\ed                   "e" in d (1 for in, 0 for not in)
                        ?    }edG               if d[-1] in "abcde...z" else
                                 Y              dummy value
 s                                            combine all the lists
l                                             print the length                                      
added 88 characters in body
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108

Pyth, 43 42 4444 42 bytes

lsmf|!@<G5dq%T2}\odlsm-%R2}hKvMc-ecd\:G\-eKceK?}\ed}edGYc-rzZd\,

Try it online: DemonstrationDemonstration or Test harness

The explanation is still for the 44 bytes solution. Gonna change it soon.

Pyth, 43 42 44 bytes

lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-rzZd\,

Try it online: Demonstration

Pyth, 43 42 44 42 bytes

lsm-%R2}hKvMc-ecd\:G\-eK?}\ed}edGYc-rzZd\,

Try it online: Demonstration or Test harness

The explanation is still for the 44 bytes solution. Gonna change it soon.

added 115 characters in body
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108
lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-rz0d\rzZd\,
lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-zd\rzZd\,  implicit: z = input string
                                      rzZ     convert z to lower-zdcase
                                     -   d    remove all spaces from z
                                    c     \,  and split by ","
  m                                           map each part d to:
                           cd\:                 split d by ":"
                          e                     and only use the last part (removes page number)
                         -     G                remove all letters (removes odd/even)
                        c       \-              split by "-"
                      vM                        and evaluate all (one or two) numbers
                     K                          and store the result in K
                   }hK            eK            create the list [K[0], K[0]+1, ..., K[-1]]
   f                                            filter for numbers T in this list, which satisfy:
      @<G5d                                       the intersection of "abcde" and d
     !                                            is empty (no odd/even in d)
    |                                             or
            %T2                                   T mod 2
           q                                      equals
               }\od                               "o" in d
 s                                            combine all the lists
l                                             print the length      
                            
lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-rz0d\,
lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-zd\,  implicit: z = input string
                                     -zd    remove all spaces from z
                                    c   \,  and split by ","
  m                                         map each part d to:
                           cd\:               split d by ":"
                          e                   and only use the last part (removes page number)
                         -     G              remove all letters (removes odd/even)
                        c       \-            split by "-"
                      vM                      and evaluate all (one or two) numbers
                     K                        and store the result in K
                   }hK            eK          create the list [K[0], K[0]+1, ..., K[-1]]
   f                                          filter for numbers T in this list, which satisfy:
      @<G5d                                     the intersection of "abcde" and d
     !                                          is empty (no odd/even in d)
    |                                           or
            %T2                                 T mod 2
           q                                    equals
               }\od                             "o" in d
 s                                          combine all the lists
l                                           print the length      
                            
lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-rzZd\,
lsmf|!@<G5dq%T2}\od}hKvMc-ecd\:G\-eKc-rzZd\,  implicit: z = input string
                                      rzZ     convert z to lower-case
                                     -   d    remove all spaces from z
                                    c     \,  and split by ","
  m                                           map each part d to:
                           cd\:                 split d by ":"
                          e                     and only use the last part (removes page number)
                         -     G                remove all letters (removes odd/even)
                        c       \-              split by "-"
                      vM                        and evaluate all (one or two) numbers
                     K                          and store the result in K
                   }hK            eK            create the list [K[0], K[0]+1, ..., K[-1]]
   f                                            filter for numbers T in this list, which satisfy:
      @<G5d                                       the intersection of "abcde" and d
     !                                            is empty (no odd/even in d)
    |                                             or
            %T2                                   T mod 2
           q                                      equals
               }\od                               "o" in d
 s                                            combine all the lists
l                                             print the length      
                            
added 14 characters in body
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108
Loading
added 1830 characters in body
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108
Loading
added 1830 characters in body
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108
Loading
Source Link
Jakube
  • 21.9k
  • 3
  • 27
  • 108
Loading