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

Jelly,  9  8 bytes

O’%3ṣ0§Ṁ

Try it online!

How?

O’%3ṣ0§Ṁ - Link: list of characters   e.g. "wwwvWvwWww"
O        - ordinals                        [119,119,119,118,87,118,119,87,119,119]
 ’       - decremented                     [118,118,118,117,86,117,118,86,118,118]
  %3     - modulo three                    [1,1,1,0,2,0,1,2,1,1]
    ṣ0   - split at zeros                  [[1,1,1],[2],[1,2,1,1]]
      §  - sums                            [3,2,5]
       Ṁ - maximum                         5

Jelly,  9  8 bytes

O’%3ṣ0§Ṁ

Try it online!

How?

O’%3ṣ0§Ṁ - Link: list of characters
O        - ordinals
 ’       - decremented
  %3     - modulo three
    ṣ0   - split at zeros
      §  - sums
       Ṁ - maximum

Jelly,  9  8 bytes

O’%3ṣ0§Ṁ

Try it online!

How?

O’%3ṣ0§Ṁ - Link: list of characters   e.g. "wwwvWvwWww"
O        - ordinals                        [119,119,119,118,87,118,119,87,119,119]
 ’       - decremented                     [118,118,118,117,86,117,118,86,118,118]
  %3     - modulo three                    [1,1,1,0,2,0,1,2,1,1]
    ṣ0   - split at zeros                  [[1,1,1],[2],[1,2,1,1]]
      §  - sums                            [3,2,5]
       Ṁ - maximum                         5
added 21 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 9 9  8 bytes

O%5%3ṣ0§ṀO’%3ṣ0§Ṁ

Try it online!Try it online!

How?

O’%3ṣ0§Ṁ - Link: list of characters
O        - ordinals
 ’       - decremented
  %3     - modulo three
    ṣ0   - split at zeros
      §  - sums
       Ṁ - maximum

Jelly, 9 bytes

O%5%3ṣ0§Ṁ

Try it online!

Jelly,  9  8 bytes

O’%3ṣ0§Ṁ

Try it online!

How?

O’%3ṣ0§Ṁ - Link: list of characters
O        - ordinals
 ’       - decremented
  %3     - modulo three
    ṣ0   - split at zeros
      §  - sums
       Ṁ - maximum
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 9 bytes

O%5%3ṣ0§Ṁ

Try it online!