We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
main = do
n_temp <- getLine
let n = read n_temp :: Float
arr_temp <- getLine
let arr = map read $ words arr_temp :: [Int]
print (get_frac arr n (>0))
print (get_frac arr n (<0))
print (get_frac arr n (==0))
get_frac arr n p = fromIntegral (length (filter p arr)) / n
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
"Same" in Haskell: