Browse Source

Clean up

master
Micah Halter 1 year ago
parent
commit
536dfc1f44
  1. 2
      16-flawed-frequency-transmission/answer.hs

2
16-flawed-frequency-transmission/answer.hs

@ -12,7 +12,7 @@ fft num input = foldl (\arr i -> step arr) input [1..num]
step input = map (\(i, k) -> (abs . foldl (+) 0 $ zipWith (*) (pattern i) input) `mod` 10) $ zip [1..] input
partfft :: Int -> [Int] -> [Int]
partfft n = head . drop n . iterate (map (\n -> (abs n) `mod` 10) . reverse . tail . scanl (+) 0 . reverse)
partfft n = head . drop n . iterate (map ((`mod` 10) . abs) . reverse . tail . scanl (+) 0 . reverse)
solveA :: [Int] -> String
solveA = concatMap show . take 8 . fft 100

Loading…
Cancel
Save