[我正在Haskell的Hackerrank中从事string compression problem工作,并一直停留在IO上。我正在尝试明确删除引号。
compress :: [Char] -> [Char]
compress = ...
main :: IO ()
main = do
input <- getLine
let result = compress input
print $ filter (/='"') result
代码编译并返回正确的响应,尽管用引号引起来。
Compiler Message
Wrong Answer
Input (stdin)
abcaaabbb
Your Output (stdout)
"abca3b3"
Expected Output
abca3b3
您写:
putStrLn result
代替最后一行:
print $ filter (/='"') result