Created
October 18, 2021 12:02
-
-
Save crclark96/4114dfdfa7fb0a7ee293e6485d995e07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List (sortOn) | |
reorder :: [Char] -> [Int] -> [Char] | |
reorder a b = map fst . sortOn snd $ zip a b | |
a = ['C'..'H'] | |
b = [3, 0, 4, 1, 2, 5] | |
main = putStrLn $ reorder a b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment