Skip to main content
deleted 29 characters in body
Source Link
Zylviij
  • 470
  • 2
  • 5

Haskell, 99

Another approach... I just learned about function aliasing

import Data.List
s=subsequences
i=intersect
l=length
f n=2^(l$last$i(s"lucky")$s n)-2*l(i n$"omen")

Haskell is my new love :D

Usage

f"lucky"
32

f"firetruck"
6

f"memes"
-7

Haskell, 99

Another approach... I just learned about function aliasing

import Data.List
s=subsequences
i=intersect
l=length
f n=2^(l$last$i(s"lucky")$s n)-2*l(i n$"omen")

Haskell is my new love :D

Usage

f"lucky"
32

f"firetruck"
6

f"memes"
-7

Haskell, 99

Another approach... I just learned about function aliasing

import Data.List
s=subsequences
i=intersect
l=length
f n=2^(l$last$i(s"lucky")$s n)-2*l(i n$"omen")

Usage

f"lucky"
32

f"firetruck"
6

f"memes"
-7
Source Link
Zylviij
  • 470
  • 2
  • 5

Haskell, 99

Another approach... I just learned about function aliasing

import Data.List
s=subsequences
i=intersect
l=length
f n=2^(l$last$i(s"lucky")$s n)-2*l(i n$"omen")

Haskell is my new love :D

Usage

f"lucky"
32

f"firetruck"
6

f"memes"
-7