blob: 40ccf14bceac143c76a13c58d6f243bfbdb9637d (
plain)
1
2
3
4
5
6
|
#lang racket
(define/contract (num-jewels-in-stones jewels stones)
(-> string? string? exact-integer?)
(for/sum ([jewel (in-string jewels)])
(count (curry char=? jewel) (string->list stones))))
|