aboutsummaryrefslogtreecommitdiff
path: root/racket/leetcode/lc-551-student-attendance-record-1.rkt
blob: c5f14566d0bbbc4c9fd6ff16ca8fc89b46eb0357 (plain)
1
2
3
4
5
6
7
8
9
10
11
#lang racket

(define/contract (check-record s)
  (-> string? boolean?)
  (define s-list (map string (string->list s)))
  (cond [(<= 2 (count (curry string=? "A") s-list)) #false]
        [(string-contains? s "LLL") #false]
        [else #true]))

(check-record "PPALLP")
(check-record "PPALLL")