Mars Exploration

  • + 0 comments

    Haskell

    module Main where
    
    import Data.List (cycle)
    
    solve :: String -> Int
    solve = length . filter id . zipWith (/=) (cycle "SOS")
    
    main :: IO ()
    main = getLine >>= print . solve