Largest int from concatenated ints: Difference between revisions

Line 207:
 
main = print (map maxcat [[1,34,3,98,9,76,45,4], [54,546,548,60]] :: [Integer])
where
where sorted = sortBy (flip $ comparing $ take 10 . cycle)
sorted xs = let maxcatpad =x read .= concat .$ sortedreplicate (maxLen `div` length x .+ map1) show</lang>x
maxLen = maximum $ map length xs
where sorted = in sortBy (flip $ comparing $ take 10 . cyclepad) xs
 
maxcat = read . concat . sorted . map show</lang>
 
{{out}}
Anonymous user