in reply to Golf code in perl

Oooh, a golf thread. also 44 strokes:

m? ?||map$\+=2*$s[$_%$']++,split for<>;print

In older perls you could leave out the initial m and it would have been 43

Replies are listed 'Best First'.
Re^2: Golf code in perl
by thospel (Hermit) on Jan 25, 2018 at 00:25 UTC
    And for 40:

    print<>!~($/=$")+2*map 1..$s{$_%$'}++,<>