Skip to content

Instantly share code, notes, and snippets.

@pjrt
Created April 14, 2016 22:09
Show Gist options
  • Save pjrt/39b002e86514e6581b0269ad7181f912 to your computer and use it in GitHub Desktop.
Save pjrt/39b002e86514e6581b0269ad7181f912 to your computer and use it in GitHub Desktop.
findLowest :: [Int] -> [Int] -> Int
findLowest as bs = findLowest' (sort as) (sort bs)
where
findLowest' _ [] = -1
findLowest' [] _ = -1
findLowest' (a:ta) (b:tb)
| a == b = a
| b < a = findLowest' (a:ta) (tb)
| otherwise = findLowest' ta (b:tb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment