Browse Source

Clean up

master
Micah Halter 1 month ago
parent
commit
536dfc1f44
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      16-flawed-frequency-transmission/answer.hs

+ 1
- 1
16-flawed-frequency-transmission/answer.hs View File

@@ -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