22 lines
373 B
Haskell
22 lines
373 B
Haskell
import System.IO
|
|
import Data.List
|
|
|
|
|
|
|
|
|
|
marker :: Int -> Int -> String -> Int
|
|
marker p n s@(_:xs)
|
|
| unique == n = p+n
|
|
| otherwise = marker (p+1) n xs
|
|
where
|
|
unique = length $ nub $ take n s
|
|
|
|
|
|
handler :: String -> String
|
|
handler s = (show $ marker 0 4 s) ++ "\n" ++
|
|
(show $ marker 0 14 s) ++ "\n"
|
|
|
|
main :: IO ()
|
|
main = do
|
|
interact handler
|