import Data.Maybe(listToMaybe)
import qualified Data.Set as S
smallestNumber :: Int -> Maybe Int
smallestNumber n = listToMaybe [a + b*10 + c*100 | c <- [0..9],
b <- [0..9],
a <- [0..9],
a*b*c == n]
findAdditionals :: Ord a => [a] -> [a] -> [a]
findAdditionals xs ys = foldl (\acc x-> if S.member x s then acc else x:acc) [] ys
where s = S.fromList xs
main = do
print $ smallestNumber 100
print $ smallestNumber 20
print $ smallestNumber 476
print $ findAdditionals [4,7,9,6,1,3,8] [3,4,1,8,2,9,5,7,6]