Re:Choosing a Programming Language for Interviews
by benhoyt on Wednesday February 05, 2014 @02:21PM
(#7186092)
Really, that's easy peasy? Looks terrible to a Python programmer. :-)
[ Parent
| on HN ]
Re:Choosing a Programming Language for Interviews
by biscarch on Wednesday February 05, 2014 @03:16PM
(#7186487)
I would've went with Haskell myself ;)
main :: IO ()
main = writeListAsLines . toDoubleList . lines =<< readFile "nums.txt"
where
toDoubleList y = zipWith (*) (map read y) [1..length y]
writeListAsLines z = writeFile "output.txt" (concat $ intersperse "\n" $ map show z)