Skip to main content
added 561 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 21 bytes

“CSO“ANM“U“VZX”iⱮ€§ḅ-

A monadic Link accepting a list of characters which yields an integer.

Try it online!

How?

“CSO“ANM“U“VZX”iⱮ€§ḅ- - Link: list of characters, W
“CSO“ANM“U“VZX”       - list of lists of characters = [['C','S','O'],['A','N','M'],['U'],['V','Z','X']]
                 €    - for each (L in those four lists):
                Ɱ     -   map across (c in W) with:
               i      -     first (1-based) index (of c in L) or 0 if not found
                  §   - sum each resulting list
                    - - literal minus one
                   ḅ  - convert (the list of four sums) from base (-1)

Jelly, 21 bytes

“CSO“ANM“U“VZX”iⱮ€§ḅ-

A monadic Link accepting a list of characters which yields an integer.

Try it online!

Jelly, 21 bytes

“CSO“ANM“U“VZX”iⱮ€§ḅ-

A monadic Link accepting a list of characters which yields an integer.

Try it online!

How?

“CSO“ANM“U“VZX”iⱮ€§ḅ- - Link: list of characters, W
“CSO“ANM“U“VZX”       - list of lists of characters = [['C','S','O'],['A','N','M'],['U'],['V','Z','X']]
                 €    - for each (L in those four lists):
                Ɱ     -   map across (c in W) with:
               i      -     first (1-based) index (of c in L) or 0 if not found
                  §   - sum each resulting list
                    - - literal minus one
                   ḅ  - convert (the list of four sums) from base (-1)
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 21 bytes

“CSO“ANM“U“VZX”iⱮ€§ḅ-

A monadic Link accepting a list of characters which yields an integer.

Try it online!