blob: f9714b7ae6d5d822831d6d98c5c00c9c9c0372d3 (
plain)
1
2
3
4
5
6
7
|
#lang racket
(define/contract (min-deletion-size strs)
(-> (listof string?) exact-integer?)
(define transposed-strs (apply map list (map string->list strs)))
(count (λ (s) (not (equal? s (sort s char<?)))) transposed-strs))
(min-deletion-size '["cba" "daf" "ghi"])
|